Overview
Vocantly is a multi-tenant chat and customer support platform that provides real-time messaging, AI-powered bots, and comprehensive support features. This guide will help you integrate Vocantly into your application.JavaScript SDK
Integrate Vocantly into your app
API Reference
Explore REST API endpoints
Authentication
Learn about authentication
Architecture
Understand the platform
Prerequisites
Before you begin, you’ll need:- A Vocantly account (sign up or contact support@vocantly.com)
- An App (create one in the dashboard). Store App ID, public key, and secret key on your backend only.
- A modern web browser or Node.js environment
JavaScript SDK
The easiest way to integrate Vocantly into your application is using our JavaScript SDK.Installation
npm install @vocantly/sdk@beta
Basic Setup
Your backend issues an SDK token viaPOST /api/v1/apps/:appId/tokens (JWT or X-Api-Key + X-Api-Secret). Your frontend receives only the token—never keys.
apiUrl. With the same token, the SDK will call GET /sdk/conversations and GET /sdk/conversations/:id/messages using Bearer auth.
Join a Conversation
Send a Message
Receive Messages
Typing Indicators
Presence
Complete Example
REST API
Use the REST API for reading data and managing resources. Dashboard access uses JWT (login/register). SDK tokens are issued by your backend viaPOST /apps/:id/tokens (JWT or API key).
Dashboard authentication (login)
{ "access_token", "refresh_token", "user" }.
Issue SDK token (backend)
Your backend callsPOST /api/v1/apps/:appId/tokens with JWT or API key (X-Api-Key + X-Api-Secret). See Issue SDK Token. Return the token to your frontend; never expose keys.
Backend integration (external chat)
To add chat to your app (e.g. order chat, appointment chat) without dashboard login:- Create conversation when your business event occurs:
POST /api/v1/conversations/externalwithX-Api-KeyandX-Api-Secret. Body:external_id(your ID, e.g. order or appointment ID) andparticipants(at least 2; each withexternal_user_id, optionalname,email,role). See Create EXTERNAL (API Key). - Issue SDK token for the current user:
POST /api/v1/apps/:appId/tokenswith the same API keys andexternal_user_idmatching a participant. See Issue SDK Token. - Return
{ token, conversation_id: data.id }to your frontend. - Frontend uses the SDK with
token, callsclient.connect(), thenclient.conversations.join(conversation_id)and sends/receives messages.
Make API requests (dashboard)
Use the access token in subsequent requests:REST API is for reading data only. Use the SDK for sending messages.
WebSocket Connection
Use the SDK (recommended) or connect manually. The token comes from your backend; never use keys in the frontend.Next Steps
SDK Documentation
Complete SDK reference and examples
API Reference
Explore all API endpoints
Authentication
Learn about authentication flows
Webhooks
Set up webhooks for events
Getting Help
Where do I get my API credentials?
Where do I get my API credentials?
Sign up, create an App in the dashboard, and store App ID, public key, and secret key on your backend. Your frontend receives only tokens from your backend via
POST /apps/:id/tokens. See Issue SDK Token.How do I handle errors?
How do I handle errors?
The SDK provides error handling. Check the SDK documentation for error handling patterns.
Can I use Vocantly in a mobile app?
Can I use Vocantly in a mobile app?
Yes! The SDK works in React Native and other JavaScript environments. Check the SDK documentation for platform-specific guides.
Support
- 📧 Email: support@vocantly.com
- 📚 Documentation: Browse our guides and API reference
- 💬 Questions: Contact our support team