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

For testing (beta): npm install @vocantly/sdk@beta

Basic Setup

Your backend issues an SDK token via POST /api/v1/apps/:appId/tokens (JWT or X-Api-Key + X-Api-Secret). Your frontend receives only the token—never keys.
Optional (inbox): To list conversations and fetch message history, add 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

Messages are sent exclusively over WebSockets.This guarantees ordering, real-time delivery, typing indicators, presence, and receipts.Use client.conversations.get(conversationId).sendMessage(content) to send messages.REST APIs are used for history, analytics, and internal automation only.

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 via POST /apps/:id/tokens (JWT or API key).

Dashboard authentication (login)

Response: { "access_token", "refresh_token", "user" }.

Issue SDK token (backend)

Your backend calls POST /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:
  1. Create conversation when your business event occurs: POST /api/v1/conversations/external with X-Api-Key and X-Api-Secret. Body: external_id (your ID, e.g. order or appointment ID) and participants (at least 2; each with external_user_id, optional name, email, role). See Create EXTERNAL (API Key).
  2. Issue SDK token for the current user: POST /api/v1/apps/:appId/tokens with the same API keys and external_user_id matching a participant. See Issue SDK Token.
  3. Return { token, conversation_id: data.id } to your frontend.
  4. Frontend uses the SDK with token, calls client.connect(), then client.conversations.join(conversation_id) and sends/receives messages.
Same API keys for both steps; no JWT or dashboard session required.

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

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.
The SDK provides error handling. Check the SDK documentation for error handling patterns.
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