Hey,
I am using React UIKit with angular. I have created a react chat component and sending appkey, userid and nickname to initialize chat.
We are making manual calls to register our users before using chat. Now we want to pass the list of users from our backend to sendbird UIKit.
I found that we can use the filter by userid but it has a limitation of only 250 users.
I have created a list of sendbird user object but don’t know where I should pass that list.
This is how we are initializing chat component.
Thank you in advance.
Hey @Jay_Patel,
Was there supposed to be a snippet for how you are initializing chat component? Have you referenced this part of the documentation?
Het @Alex_Preston, Thank you for your response. I am able to solve the issue by using customuserquery component.
And yes I have added snippent but don’t know why it is not showing.
Can you share a snippet of your implementation of customuserquery
@Sravan_S Sure. Here is the snippet.
<SendBirdProvider appId={appkey} userId={userid} nickname={nickname} userListQuery={customUserQuery}> <ChannelComponent /> </SendBirdProvider>
Here is customUserQuery
import axios from 'axios';
import * as Cookies from 'js-cookie';
class CustomUserQuery {
next(callback): void {
const headers = {
'Content-Type': 'application/json',
'Authorization': Cookies.get('token')
}
axios.get("api to get user", {
headers: headers
}).then(response => {
const error = false;
const users = response.data.UsersList;
callback(users, error);
});
}
}
export default () => new CustomUserQuery();