Sendbird Notification
Javascript Functions to integrate SendBird chat into your app.
Initialize
Initializes SendBird with a user ID and connects the user to the SendBird service.
window.WTN.SendBird.sendbirdInitialize({
userId: "user123",
nickname: "John",
profileurl: "https://example.com/avatar.png",
callback: function (response) {
console.log(response);
},
});import { sendbirdInitialize } from "webtonative/build/SendBird";
sendbirdInitialize({
userId: "user123",
nickname: "John",
profileurl: "https://example.com/avatar.png",
callback: (response) => {
console.log(response);
},
});Parameters:
userId
String
Yes
The unique user ID to connect with.
nickname
String
No
Display name for the user.
profileurl
String
No
URL of the user's profile image.
callback
Function
No
Callback function invoked with the response.
Is Initialized
Checks whether SendBird has been initialized.
Callback Response:
initialized
Boolean
Whether SendBird has been initialized.
appId
String
The SendBird application ID.
Is Connected
Checks whether the user is currently connected to SendBird.
Callback Response:
connected
Boolean
Whether the user is connected to SendBird.
Get User ID
Retrieves the currently connected user's ID.
Callback Response:
userId
String
The current user's SendBird user ID.
Update User Info
Updates the current user's nickname and/or profile image URL.
Parameters:
nickname
String
No
The new display name for the user.
profileurl
String
No
The new profile image URL for the user.
callback
Function
No
Callback function invoked with the response.
Callback Response:
success
Boolean
Whether the user info was updated.
Create Group Channel
Creates a new group channel with the specified users.
Parameters:
name
String
No
The name of the group channel.
userIds
String[]
No
An array of user IDs to add to the channel.
isDistinct
Boolean
No
If true, reuses an existing channel with the same members instead of creating a new one.
callback
Function
No
Callback function invoked with the response.
Callback Response:
success
Boolean
Whether the channel was created successfully.
channelUrl
String
The URL of the created group channel.
Show UI
Opens the full SendBird chat UI showing the channel list.
Callback Response:
success
Boolean
Whether the UI was shown successfully.
status
String
Status of the UI display operation.
Show Channel UI
Opens the SendBird chat UI for a specific channel.
Parameters:
url
String
No
The channel URL to open.
callback
Function
No
Callback function invoked with the response.
Callback Response:
success
Boolean
Whether the channel UI was shown successfully.
status
String
Status of the UI display operation.
channelUrl
String
The URL of the displayed channel.
Disconnect
Disconnects the current user from SendBird. The user can reconnect later using sendbirdInitialize.
Callback Response:
success
Boolean
Whether the disconnect was successful.
Logout
Logs out the current user from SendBird and cleans up all resources including push notification tokens.
Callback Response:
success
Boolean
Whether the logout was successful.
Logout differs from disconnect in that it also unregisters the device's push notification token and clears all stored SendBird data. Use sendbirdDisconnect for temporary disconnections and sendbirdLogout when the user is signing out of your app.
Feature taken live on 30/03/26
Last updated