[Problem/Question]
Environment: AppRouter (SSR)
Error: SendBirdCall needs 'window' in global
[SDK Version]
Latest
[Reproduction Steps]
// app/page.tsx
...
export default function page() {
// Initialize the SendBirdCall instance to use APIs in your app.
SendBirdCall.init(APP_ID)
// The USER_ID below should be unique to your Sendbird application.
const authOption = { userId: USER_ID, accessToken: ACCESS_TOKEN };
SendBirdCall.authenticate(authOption, (result, error) => {
if (error) {
// Handle authentication failure.
} else {
// The user has been successfully authenticated and is connected to
the Sendbird server.
//...
}
});
// Establishing websocket connection.
SendBirdCall.connectWebSocket()
.then(/* Succeeded to connect */)
.catch(/* Failed to connect */);
return (
<div></div>
)
}
[Frequency]
Only init
method call
[Current impact]
Error