Export User Data

Last Edit: Nov 27 2020

To export user data, Stream Chat exposes an exportUser method. This method can only be called server-side due to security concerns, so please keep this in mind when attempting to make the call.

Below is an example of how to execute the call to export user data:


const data = await client.exportUser('user_id');
                    

response = client.export_user("user_id");
                    

response = @client.export_user('user_id')
                    

$response = $this->client->exportUser($user["id"]);
                    

var exportedUser = await this._endpoint.Export(user1.ID);
                    

The export will return all data about the user, including:

  • User ID

  • Messages

  • Reactions

  • Custom Data

Users with more than 10,000 messages will throw an error during the export process. The Stream Chat team is actively working on a workaround for this issue and it will be resolved soon.