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.
To migrate your code, follow these steps:
Follow the installation instructions to install the @wix/inbox
SDK package for your development environment.
Update import statements.
wix-chat-backend
Inbox SDK
Migrate send message functionality.
wix-chat-backend
Inbox SDK
Note: Note the following differences in the code examples above:
channelId
field becomes conversationId
.direction
, and visibility
.basic
, template
, minimal
, form
).Migrate event handlers.
wix-chat-backend
Velo Inbox Events
Note:
Note that a single onMessage()
event handler becomes 2 directional events: onMessageSentToBusiness()
and onMessageSentToParticipant()
.
wix-chat-backend | inbox events | Description |
---|---|---|
event.payload.text | event.data.message.content.previewText | Message text content |
event.participantId | event.data.message.sender.contactId | Sender identifier |
event.channelId | event.data.conversationId | Conversation identifier |
event.direction | event.data.message.direction | Message direction |
event.createdAt | event.data.message._createdDate | Message creation timestamp |