I am trying to integrate the Sendbird JavaScript SDK into my Angular 8 application. However, I’m unable to connect a user without providing an access token, even though the “Allow users without access tokens” setting in the dashboard is set to “Read & Write”.. I get a SendBirdException: This session token is invalid
error when calling the connect()
method without passing a token.
[SDK Version]
Sendbird JavaScript SDK v3.1.33
[Reproduction Steps]
- In the Sendbird dashboard, navigate to Settings > Application > Security.
- Set “Allow users without access tokens” to “Read & Write”.
- In Angular 8 app using Sendbird JS SDK v3.1.33,
call:
this.sendBirdChatService
.connect(userId) // No token
.then(user => {
this.currentUser = user;
this.connected = true;
})
.catch(err => {
console.error(‘Connection error:’, err);
});
SendBirdChatService.ts
connect(userId: string): Promise {
return new Promise((resolve, reject) => {
this.sendBird.connect(userId, (user, error) => {
if (error) {
reject(error);
} else {
resolve(user);
}
});
});
}
Console Error
chat.component.ts:91 Connection error: SendBirdException: This session token is invalid.
error.handler.ts:9 Error: Uncaught (in promise): SendBirdException: This session token is invalid.
SendBirdException: 400302
[Frequency]
100% — always occurs when access token is omitted.
[Current impact]
Blocks users from connecting unless a valid access token is provided, even though the setting explicitly allows access without one. This is preventing user login and basic chat functionality for guests or users without secure token infrastructure.