Search code examples
react-nativegetstream-io

Query user details using the getstream.io activity feed client (using React Native)


I would like to be able to fetch the user details for a list of users, preferably in a single API call. Is this possible using the JS client (my preference) or via the REST API?

There is a reference to a listUsers interface in the chat documentation:

const response = await client.queryUsers({ id: { $in: ['john', 'jack', 'jessie'] } });

but this doesn't seem to be available on the activity feed client. In my activity feed app, I am accessing the client using the <StreamApp.Consumer> in react native. client.queryUsers is not an available method on this context.

It seems that there is also no general query interface on the rest APIs. I can only see an API to fetch a single user details.

Is there a way to query user details for a list of users.


Solution

  • Not possible at the moment.

    However, it's in the backlog to be added.

    As you realize, there is a single user read.

    On the other hand, react native is a client which shouldn't query users directly. Needed users can be extended on feed/reaction read via enrichment automatically, which is the difference than chat.