Skip to content

Instantly share code, notes, and snippets.

@nemo0
Created May 28, 2023 07:36
Show Gist options
  • Save nemo0/94f9a1ae418e42b317dea7c6ebc3c4fe to your computer and use it in GitHub Desktop.
Save nemo0/94f9a1ae418e42b317dea7c6ebc3c4fe to your computer and use it in GitHub Desktop.
Call.js Initiate SendBird Calls
const initiateSendbirdCalls = async () => {
const APP_ID = process.env.NEXT_PUBLIC_APP_ID;
SendBirdCall.init(APP_ID);
try {
setLoading(true);
await authenticate();
await SendBirdCall.connectWebSocket();
addEventHandler();
setAuthenticated(true);
setLoading(false);
} catch {
setLoading(false);
setAuthenticated(false);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment