-
-
Save sendbird-community/201d5ba2b8d53ccca1258643fde6d74a to your computer and use it in GitHub Desktop.
Fetch the user credentials
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
const fetchSendbirdUserCredentials = async (sendbirdUserId) => { | |
try { | |
//Get Agents user details from Sendbird | |
const data = await client.request.invoke("getAgentsSendbirdCreds", { sendbirdUserId }) | |
//Attached agents's sendbird access_token to the data to be passed to the modal. | |
return { sendbirdUserId, access_token: JSON.parse(data.response.response).access_token } | |
} catch (e) { | |
console.log(e.message) | |
throw Error(e) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment