-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add demo of LLC without SCG #2400
Conversation
declare module 'stream-chat' { | ||
interface UserEx { | ||
customUserField: string; | ||
} | ||
|
||
interface ReactionEx { | ||
customReactionField: string; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what integrators will have to do, instead of using SCG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very nice! 🚀 Let's plan to fix this for every JS SDK
const chatClient = useCreateChatClient({ | ||
apiKey, | ||
tokenOrProvider: userToken, | ||
userData: { id: userId, customUserField: 'field' }, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note how userData
supports customUserField
and doesn't cause type error. That's because useCreateChatClient
uses UserResponseEx
type for it.
const { reactions } = await chatClient.queryReactions('dummy', {}); | ||
console.log(reactions[0].customReactionField); | ||
console.log(reactions[0].user?.customUserField); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, queryReactions
uses ReactionResponseEx
type, so the response contains both customReactionField
and customUserField
.
Start here: GetStream/stream-chat-js#1309
To try this demo locally, grab the
no-scg-demo
branch fromstream-chat-js
and link it locally.