Zelto
Agent Chat SDK

Getting Started

Install and set up the Agent Chat SDK in your project.

Installation

Install the SDK via your preferred package manager:

npm install @zelto/agent-chat-sdk
pnpm add @zelto/agent-chat-sdk
yarn add @zelto/agent-chat-sdk

Basic usage

Import and initialize the SDK, then mount the chat widget:

import { init, mountChat } from '@zelto/agent-chat-sdk';

init({
  apiKey: 'your-api-key',
  userId: 'user-123',
  baseUrl: 'https://api.zelto.ai',
});

mountChat();

Required options

OptionTypeDescription
apiKeystringYour Zelto API key (found in the dashboard).
userIdstringA unique identifier for the current user.

Optional options

OptionTypeDescription
baseUrlstringAPI base URL. Required for sending messages.
agentIdstringOverride the default agent.
articlesUrlstringIf set, shows an Articles tab in the widget.
themeAgentChatThemeOptionsCustomize colors and border radius.
personalizationAgentChatPersonalizationOptionsSet greeting, title, logo, and avatar.

Unmounting

To remove the chat widget from the page:

import { unmountChat } from '@zelto/agent-chat-sdk';

unmountChat();

Debugging

Use getConfigForDebug() to inspect the current configuration:

import { getConfigForDebug } from '@zelto/agent-chat-sdk';

console.log(getConfigForDebug());
// { config: { ... }, context: { ... } }

On this page