Migrate from wix-chat-backend to the Inbox SDK

The Wix Chat Backend module is deprecated.

Use this guide to migrate your chat functionality from the deprecated wix-chat-backend module to the Inbox SDK module and Velo Inbox Events.

The wix-chat-backend module is a simpler, chat-focused API that sends text messages via chat widget interactions. The Inbox SDK module is a more comprehensive inbox messaging platform that handles structured conversations across multiple communication channels as well as basic chat widget interactions.

Important: The Inbox SDK event handlers don't work for site development or for app creation with Blocks. Replace the deprecated backend event handlers with Velo Inbox Events located in the Events & Service Plugins section of the Velo API reference.

Migration steps

To migrate your code, follow these steps:

  1. Follow the installation instructions to install the @wix/inbox SDK package for your development environment.

  2. Update import statements.

    wix-chat-backend

    Copy

    Inbox SDK

    Copy
  3. Migrate send message functionality.

    wix-chat-backend

    Copy

    Inbox SDK

    Copy

    Note: Note the following differences in the code examples above:

    • The channelId field becomes conversationId.
    • Message content requires message type specification, direction, and visibility.
    • Basic text objects become structured message types (basic, template, minimal, form).
    • A Promise is now returned with a detailed message object.
  4. Migrate event handlers.

    wix-chat-backend

    Copy

    Velo Inbox Events

    Copy

    Note: Note that a single onMessage() event handler becomes 2 directional events: onMessageSentToBusiness() and onMessageSentToParticipant().

Event data structure mapping

wix-chat-backendinbox eventsDescription
event.payload.textevent.data.message.content.previewTextMessage text content
event.participantIdevent.data.message.sender.contactIdSender identifier
event.channelIdevent.data.conversationIdConversation identifier
event.directionevent.data.message.directionMessage direction
event.createdAtevent.data.message._createdDateMessage creation timestamp
Did this help?