Closed dcsan closed 5 years ago
another example where userId
param is different based on the API call
// let opts = { userId } // cannot do this
Rabbit.chatkit.getUser({id: userId}).then(currentUser => {
debug.info('connected currentUser', currentUser)
Rabbit.chatkit.getUserRooms({userId: userId}).then( (rooms, err) => {
The server SDK is intentionally lower level and more flexible. We don't want you to have to pay the cost of getting information for all the user's rooms on the server every time you want to get a user in isolation.
Regarding id
vs userId
, then convention we've tried to follow is to use id
if the context is obvious. However maybe this causes more confusion than if we were just consistent with it everywhere... thanks for the feedback.
As with the other issues, closing this as a feature request. (I've added it to our internal system.)
What?
I want to create a server based client (for a bot to listen to rooms)
with client code this works
but server I have to call another API to get users list of rooms
Suggested improvements
normalize APIs / prepopulate room list on server response