Introduction

The Vocantly JavaScript SDK is a headless SDK for integrating real-time chat, messaging, presence, and support features into your applications.
Just want a drop-in support chat bubble (AI bot + live agents) without building UI? Use the Support Widget — one <script>, works on any site (including static pages with no backend). This SDK is the headless engine underneath it.
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.

Installation

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

Quick Start

Core Features

SDK Architecture

Configuration

Minimum: wsUrl + token (from your backend). Inbox/history: add apiUrl — the same token is used as Bearer for list() and fetchMessages().

API Reference

Vocantly Client

Conversations

Conversation Instance

Support Sessions

Message Lifecycle

  1. Send Message → Optimistic message created instantly
  2. Server Confirms → Message reconciled with server data
  3. Delivered → Delivery receipt received
  4. Read → Read receipt received

Error Handling

TypeScript Support

The SDK is written in TypeScript and includes full type definitions:
For a full backend + frontend flow (token endpoint, start conversation, chat screen, inbox), see the Implementation Guide.

Next Steps

Implementation Guide

Backend + frontend integration (recommended)

Installation

Installation and setup

Authentication

How to get and use the SDK token

Conversations

Join, leave, send and receive

Inbox & history

List conversations and message history

Messaging

Messages in detail