JavaScript API
Control the Zora Support chat widget from your frontend—open chat, start conversations, and sync users.
The JavaScript API drives the embeddable chat widget in the browser. Load the cloud embed script first, then call helpers on the global chat object (commonly exposed as SBChat in the runtime).
Setup
- Paste your cloud embed snippet on the page.
- Wait until the script has initialized (or run your code after the
loadevent). - Call widget methods from your own UI—buttons, routers, or authenticated app shells.
Core chat controls
| Method | Purpose |
| --- | --- |
| SBChat.open() | Open the chat window |
| SBChat.initChat() | Ensure chat is initialized |
| SBChat.openConversation(id) | Jump to a conversation |
| SBChat.newConversation(...) | Start a new thread |
| SBChat.setConversation(...) | Bind an existing conversation |
| SBChat.submit() / SBChat.sendMessage(...) | Send content |
| SBChat.updateMessage(...) | Edit a message when allowed |
| SBChat.clear() | Reset local chat UI state |
Conversations and realtime
| Method | Purpose |
| --- | --- |
| SBChat.populateConversations() | Load the conversation list |
| SBChat.updateConversations() | Refresh list state |
| SBChat.setConversationStatus(...) | Change status from the client |
| SBChat.startRealTime() / SBChat.stopRealTime() | Control live updates |
| SBChat.typing(...) | Typing indicators |
| SBChat.busy() | Whether the widget is busy |
| SBChat.lastAgent() | Last agent on the thread |
UI helpers
| Method | Purpose |
| --- | --- |
| SBChat.showDashboard() / SBChat.hideDashboard() | Dashboard visibility |
| SBChat.showPanel() / SBChat.hidePanel() | Side panels |
| SBChat.scrollBottom() / SBChat.isBottom() | Scroll management |
| SBChat.updateNotifications(...) | Badge / notification UI |
| SBChat.showArticles() / SBChat.getArticles() | Knowledge base in-widget |
| SBChat.searchArticles(...) | Article search |
Messaging extras
Depending on your plan and enabled apps:
SBChat.sendEmail(...)SBChat.sendSMS(...)SBChat.desktopNotification(...)
Typical pattern
<button id="help">Chat with us</button>
<script>
document.getElementById("help").addEventListener("click", function () {
if (window.SBChat) {
SBChat.open();
}
});
</script>
For logged-in customers, combine widget calls with your session: identify the user via registration settings, URL parameters, or server-side Web API provisioning before opening chat.
Next
See practical recipes in Use cases and server methods in the Web API.