Companies conducting business within the European Union are legally required to comply with the General Data Protection Regulation (GDPR).
While many aspects of this regulation may not significantly affect your integration with Stream, the GDPR provisions regarding the right to data access and the right to erasure are directly pertinent.
These provisions relate to data that is stored and managed on Stream’s servers.
GDPR gives EU citizens the right to request access to their information and the right to have access to this information in a portable format. Stream covers this requirement with the export method.
The Feeds export method will export the following data where the user id the owner:
User data
Feeds
Follows
Activities
Comments
Reactions
Bookmarks
Bookmark folders
Collections
This method can only be used with server-side authentication:
// Start the export taskconst response = await client.feeds.exportFeedUserData({ user_id: userToExport.id,});// You have to poll this endpointconst taskResponse = await client.getTask({ id: response.task_id });console.log(taskResponse.status === "completed");
// Start the export taskresponse, err := client.Feeds().ExportFeedUserData(context.Background(), &getstream.ExportFeedUserDataRequest{ UserID: userToExport.ID,})if err != nil { log.Fatal(err)}// You have to poll this endpointtaskResponse, err := client.GetTask(context.Background(), response.Data.TaskID, &getstream.GetTaskRequest{})if err != nil { log.Fatal(err)}fmt.Println(taskResponse.Data.Status == "completed")
// Start the export taskExportFeedUserDataResponse response = feeds.exportFeedUserData( ExportFeedUserDataRequest.builder() .userID(userToExport.getId()) .build()).execute().getData();// You have to poll this endpointvar taskResponse = client.getTask(response.getTaskId()).execute().getData();System.out.println("completed".equals(taskResponse.getStatus()));
// Start the export task$response = $feedsClient->exportFeedUserData( new GeneratedModels\ExportFeedUserDataRequest( userID: $userToExport->id ));// You have to poll this endpoint$taskResponse = $client->getTask($response->getData()->taskID);echo $taskResponse->getData()->status === 'completed';
// Start the export taskvar response = await _feedsV3Client.ExportFeedUserDataAsync( new ExportFeedUserDataRequest { UserID = userToExport.ID });// You have to poll this endpointvar taskResponse = await _client.GetTaskAsync(response.TaskID);Console.WriteLine(taskResponse.Status == "completed");
# Start the export taskresponse = client.feeds.export_feed_user_data(user_id=user_to_export.id)# You have to poll this endpointtask_response = client.get_task(response.task_id)print(task_response.status == "completed")
# Start the export taskresponse = client.feeds.export_feed_user_data( GetStream::Generated::Models::ExportFeedUserDataRequest.new( user_id: user_to_export.id ))# You have to poll this endpointtask_response = client.get_task(response.data.task_id)puts task_response.data.status == 'completed'
You can check the status of an export request using the task ID returned when the task was created. The result of the task contains the URL to the JSON file.
The URL to the export file has an expiration of 24-hours. The link is generated every time you request the export status. The export will be available for 60 days.
The GDPR also grants EU citizens the right to request the deletion of their personal information.
Stream offers mechanisms to delete users and feeds data in accordance with various use cases, ensuring compliance with these regulations.
The following data will be deleted:
Follows where the user is owner of either source or target feed
Feeds owned by the user - will follow the logic for deleting feeds as described here
Activities owned by the user
Comments owned by the user
Reactions owned by the user
Bookmarks owned by the user
Bookmark folders owned by the user
Collections owned by the user
NOTE: This does not delete the user's account, only their Feeds data. If you want to delete the user please refer to deleting a user
Deleting user data is an irreversible operation. This goes for both soft and hard deletes.
// Start the delete taskconst response = await serverClient.feeds.deleteFeedUserData({ user_id: userToDelete.id, hard_delete: false,});// You have to poll this endpointconst taskResponse = await client.getTask({ id: response.task_id });console.log(taskResponse.status === "completed");
// Start the delete taskresponse, err := client.Feeds().DeleteFeedUserData(context.Background(), &getstream.DeleteFeedUserDataRequest{ UserID: userToDelete.ID, HardDelete: getstream.PtrTo(false),})if err != nil { log.Fatal(err)}// You have to poll this endpointtaskResponse, err := client.GetTask(context.Background(), response.Data.TaskID, &getstream.GetTaskRequest{})if err != nil { log.Fatal(err)}fmt.Println(taskResponse.Data.Status == "completed")
// Start the delete taskDeleteFeedUserDataResponse response = feeds.deleteFeedUserData( DeleteFeedUserDataRequest.builder() .userID(userToDelete.getId()) .hardDelete(false) .build()).execute().getData();// You have to poll this endpointvar taskResponse = client.getTask(response.getTaskId()).execute().getData();System.out.println("completed".equals(taskResponse.getStatus()));
// Start the delete task$response = $feedsClient->deleteFeedUserData( new GeneratedModels\DeleteFeedUserDataRequest( userID: $userToDelete->id, hardDelete: false ));// You have to poll this endpoint$taskResponse = $client->getTask($response->getData()->taskID);echo $taskResponse->getData()->status === 'completed';
// Start the delete taskvar response = await _feedsV3Client.DeleteFeedUserDataAsync( new DeleteFeedUserDataRequest { UserID = userToDelete.ID, HardDelete = false });// You have to poll this endpointvar taskResponse = await _client.GetTaskAsync(response.TaskID);Console.WriteLine(taskResponse.Status == "completed");
# Start the delete taskresponse = client.feeds.delete_feed_user_data( user_id=user_to_delete.id, hard_delete=False)# You have to poll this endpointtask_response = client.get_task(response.task_id)print(task_response.status == "completed")
# Start the delete taskresponse = client.feeds.delete_feed_user_data( GetStream::Generated::Models::DeleteFeedUserDataRequest.new( user_id: user_to_delete.id, hard_delete: false ))# You have to poll this endpointtask_response = client.get_task(response.data.task_id)puts task_response.data.status == 'completed'