Create your first ticket
Note: As Sendbird Desk works based on Sendbird Chat, the interaction between users is built and provided by Sendbird Chat.
- NodeJS 18+ along with npm
Before installing Sendbird Desk SDK, you will need an account on Sendbird Dashboard. Sign up to create a Sendbird application first.
Note: A Sendbird application gets paired up with one client app. Agents can support customers across all platforms, but customers from different Sendbird applications are excluded because all data is limited to the scope of a single application.
Step 1 Install using npm
Step 2 Initialize the Desk SDK
- Copy the
APP_IDof your Sendbird application from the dashboard. The same
APP_IDmust be used for both Chat and Desk SDKs.
- Initialize the
SendbirdChatinstance with the copied
- Pass the initialized
SendbirdChatclass as an argument to the parameter in the
Step 3 Authenticate a customer from Sendbird Chat
Every ticket in Sendbird Desk is mapped to a group channel in Sendbird Chat because messages within a ticket are handled by Sendbird Chat. Therefore, a customer needs authentication in both the Chat SDK and the Desk SDK with the same user ID. Use the
sb.connect() method to send and receive a message and the
SendBirdDesk.authenticate() method to retrieve or update a ticket.
Step 4 Create your first ticket
Ticket.create() method to create a new ticket either before or after the customer’s initial message. Once a ticket is successfully created in the Desk server, you can access the ticket and its channel through the callback from the server. When a conversation starts, the ticket is assigned to an available agent by the Desk server while messages are sent and received through the Chat SDK. However, until a customer sends the first message, agents can’t see the ticket on the dashboard.
Note: Because the
SendbirdChatinstance in a client app is connected to Sendbird server, Desk related events are delivered to the Chat SDK's event handlers. The event handlers receive callbacks from the server through the
onUserJoined(), and other event callback methods.