Created
July 8, 2019 16:29
-
-
Save dongido001/9c5a9d0e4a8f3f61a427bb3510528425 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