
This feature is in PREVIEW and may not yet be available to all customers. Functionality, scope and design may change considerably.
The WebChat SDK lets your web developers build their own chat interface for WebChat. Use it when the ready-made widget from the service snippet doesn't fit your website, for example to match your design or to start a chat from your own button.
The SDK is chat-only. It contains no audio or video libraries.
✅ Preconditions
✅ On Request: The WebChat SDK is supplied to customers on request. If you intend to implement Use Case - Setting up WebChat, get in touch with Luware Customer Success.
✅ Starting Condition for the SKD:
- You have the service's snippet, which contains the service ID and your tenant's widget key.
- If the service uses a CORS configuration, the origin of your web page is listed in it.
- Web development skills (HTML and JavaScript) and access to your website are required.
🔎 Snippet or SDK?
| Snippet | SDK | |
|---|---|---|
| Effort | Copy and paste into your page. | Development work on your website. |
| Look and feel | Ready-made Nimbus chat widget. | Your own chat interface. |
| Where to get it | The service's Snippet section in Modalities Service Settings. | See "Getting the SDK" below. |
How the SDK Connects to Nimbus
- Identification: Every chat is started with the service ID and the tenant's widget key. Take both from the service's snippet. The widget key changes when an administrator regenerates it in Modalities Tenant Settings.
- Website check: When a chat starts, Nimbus compares the origin of your page with the service's CORS configuration. Without a CORS configuration, any origin is accepted.
- Starting a chat: The visitor's display name is required. Email address and first message are optional for the SDK, while the ready-made widget asks for both name and email address. The first message becomes the Initial Message parameter in Nimbus.
- Resuming a chat: After a page reload, the SDK can resume the running chat within the tenant's Session Recovery Timeout (default 20 seconds).
- Ending a chat: When the visitor ends the chat, it ends immediately. When the page closes, Nimbus waits for the Session Recovery Timeout before ending the chat.
- Message length: A message can have up to 1600 characters.
Error Codes
When Nimbus refuses a request, the SDK reports one of these error codes:
| Error code | HTTP | Meaning and what to do |
|---|---|---|
webchat.widget_key_invalid |
403 | The widget key is missing, wrong or was regenerated. Copy the current snippet from the service. |
webchat.origin_not_allowed |
403 | Your page's origin is not in the service's CORS configuration. Add it to the CORS configuration. |
webchat.unavailable |
404 | WebChat is not active for the tenant, the service ID is unknown, or WebChat is off for the service. |
webchat.session_not_found |
404 | The chat to resume or end doesn't exist. Start a new chat. |
webchat.session_ended |
404 | The chat has already ended, for example after the Session Recovery Timeout. Start a new chat. |
webchat.validation_failed |
400 | The request is incomplete or invalid, for example a missing display name. |
webchat.temporarily_unavailable |
503 | The service can't take more chats right now, for example because its chat limit is reached. Ask the visitor to try again later. |
webchat.internal_error |
500 | An unexpected error occurred. Try again. If it persists, contact Luware Support. |
Known Limitations
☝️ Important: Known WebChat SDK Limitations
- Chat only: No audio, video or screen sharing. For these, use the Interact SDK.
- No attachments: Images and files can't be sent.
- No authentication: Visitors are not authenticated. The tenant Authorization Mode is fixed to None.
- No service status: The SDK doesn't provide opening hours or service availability.