Sendbird Calls – chat integration

Sendbird Calls – chat integration


display a message about a finished call in the chat
enable call integration in the panel and adjust the returned value

Having a custom chat built using the SendBird service, it’s not a rare situation to add Voice and a Video conversation into the chat module. This allows for seamless switching between chats and calls.

SendBird Calls API was launched in early 2020 and it increases the number of features every couple of months. Let’s find out how to enable integration between calls and chat.

Enabling integration

Chat and Call APIs use separate SDKs. To enable integration between the two, we need to follow an extra step. In the SB Panel: Settings / Chat / Messages – ‘Calls integration to Chat’ checked -> direct_call:end checkbox.

Window with chat options


We need to inform the Calls component about the current channelUrl. Having this, a special message will be automatically sent to the chat after a call ends. The trick is to extend dialParams with sendBirdChatOptions options and pass the channelUrl value.

// SendBird in React - calls integration
// method for initializing the Call
makeCall() {
  let callOption = this.getCallOptions();
  const channelUrl = this.props.channelUrl;
  const dialParams = {
    userId: this.state.targetUserId,
    isVideoCall: this.isVideoCall(),
    sendBirdChatOptions: {
  const call = SendBirdCall.dial(dialParams, (call, error) => {
    if (error) {
      this.setState({errorMsg: error.toString()})
    } else {
      this.setState({errorMsg: ''})

Handling message text

After a call is finished, the chat will receive the message: direct_call:end. It would be better to display a more human friendly text. To achieve this, we need to prepare a custom message component to change the rendering of the message. The first step is to overwrite the renderChatItem attribute. The chat will now use our function.

  renderChatItem={({ message, onDeleteMessage, onUpdateMessage, channel, chainBottom}) => (

As for the message handler, we’re simply checking the message.message parameter and showing a different value.

// src/Chat/Message.jsx
export const MyCustomChatMessage = React.memo((props) => {
    // eslint-disable-next-line
    const {message, onDeleteMessage, onUpdateMessage, channelUrl, channel, chainBottom} = props;
    // hack - to translate "direct_call:end"
    if(message.message === "direct_call:end") {
        message.customType = "info";
        message.message = 'Conversation has been recorded and completed successfully.';
    return  (

Communication app empty message window

That’s it for today’s tutorial, make sure to follow us for other tips and guidelines, and don’t forget to subscribe to our newsletter

Need help?

  • Looking for support from experienced programmers?

  • Need to fix a bug in the code?

  • Want to customize your webste/application?


Your email address will not be published.

createIT Contact