-
-
Save BrightnBubbly/3646290a864dc81d9aacc23014cf2093 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [...] | |
async initializeClient () { | |
// Initialize the StreamChat SDK | |
const {data} = await axios.post('/api/generate-token', { | |
username: this.autheduser.email.replace(/[@\.]/g, '_') | |
}) | |
const client = new StreamChat(process.env.MIX_STREAM_API_KEY, {timeout: 9000}); | |
await client.setUser( | |
{ | |
id: this.autheduser.email.replace(/[@\.]/g, '_'), | |
name: this.autheduser.name, | |
}, | |
data.token, | |
); | |
this.client = client | |
}, | |
// [...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment