Overview
The Vocantly Widget (@vocantly/widget) is a drop-in support chat bubble built on top of
the headless SDK. One <script> renders a floating launcher + chat panel; your visitors talk to the
AI bot (and human agents) with zero UI work on your side. Everything — the SDK, its dependencies,
and the UI — is bundled into a single self-contained file.
The SDK (
@vocantly/sdk) is headless — logic only, no UI. Use it directly if you want to
build your own chat interface. Use the widget when you want a ready-made bubble.Install
The security model
The widget runs in the browser, so it only ever holds an SDK token (scoped to one app + one visitor, short-lived). Your API secret never touches the browser.Option 1 — Backend-provisioned (recommended when you have a server)
Your server mints a session with your API key + secret and hands only{ token, conversation_id } to
the page. Best when you already know who the visitor is (logged-in users).
1
Server mints a session
2
Frontend boots the widget
Option 2 — Anonymous, no backend (public key)
For a static landing page with unauthenticated visitors and no server, embed with your app’s public key. The widget self-provisions an anonymous session — no secret in the browser.{token, conversationId}, so a
reload resumes the same conversation and maps to the same customer.
Options
Controlling the widget
Pre-chat contact capture
WithcollectContact: true, the widget asks the visitor for their name + (optional) email before
chatting and saves it to their customer profile via PATCH /sdk/customers/me (authenticated by the
SDK token — no secrets). Agents then see the visitor’s contact details in the inbox.