-
Notifications
You must be signed in to change notification settings - Fork 308
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
StreamChat.createToken(id) throws TypeError: Cannot read property 'sign' of null
#53
Comments
Hey @harrisonschwartz, Client generated using secret key is only meant to be used on serverside. Seems like you are using it on clientside (on browser or mobile - react-native) |
@syntax-e ping. Any update on this? Do you have any followup questions on this? |
Closing this for now. Please reopen if you have more questions!! |
@vishalnarkhede how do I obtain the token by creating a user in the stream-CLI? According to the docs: "For development applications, it is possible to disable token authentication and use client-side generated tokens. Disabling auth checks is not suitable for a production application and should only be done for proofs-of-concept and applications in the early development stage. To enable development tokens, you need to change your application configuration." I have also tried to use chatClient.devToken(id) and I'm getting the following error: { Thanks in advance! |
If someone has the same problem:The following post solved my problem: |
@vishalnarkhede I'm getting
Any solution or what I might do differently? |
Repro steps:
const chatClient = new StreamChat(key, secret)
chatClient.createToken(userId)
Result:
TypeError: Cannot read property 'sign' of null
on line 2848 ofstream-chat/dist/browser.js
jwt
is null injwt.sign(payload, apiSecret, opts)
var jwt = null
is declared on line 2831 but is never initialized to anythingExpected:
Note:
chatClient.devToken(userId)
and subsequently callingchatClient.setUser({id, name, image})
The text was updated successfully, but these errors were encountered: