Pricing Updates ✨ Grouped chats and quick actions Login Start your trial

Node SDK

Use the official Chatness SDK for server to integrate Chatness into your system. The SDK provides a secure way to interact with Chatness API and customize functionality.

Installation

You can install the Chatness SDK for server using npm or any other package manager.

npm install @chatness/server

Setup

In order to use the SDK, you need to initialize it with your organization token and a bot ID. Learn how to get your organization token. You can grab the bot ID from the Chatness dashboard.

chatness-setup.ts
import { Chatness } from '@chatness/server';

const orgToken = 'your-organization-token';
const botId = 'your-bot-id';

// export the chat instance
// so you can reuse it across your app
export const chat = new Chatness({ orgToken, botId });

Never expose your organization token in the client-side code.

Contacts authorization

Generate a token for contact authorization.

chat.auth.contacts.tokenize({ ...payload })

Payload

Either id or email should be provided.

Revoke authorization

Revoke a contact authorization. Will logout the contact from all devices.

chat.auth.contacts.revoke({ ...payload })

Payload

Create a contact

Create a new contact.

chat.contacts.create({ ...payload })

Payload

Name
wid
Type
string
Description
WhatsApp integration
Name
mid
Type
string
Description
Messenger integration

Contacts bulk import

Create or update contacts in bulk.

chat.contacts.upsert([{ ...payload }])

Payload

Name
wid
Type
string
Description
WhatsApp integration
Name
mid
Type
string
Description
Messenger integration

Search contacts

Search for contacts by name, email, phone, id, mid, or wid.

chat.contacts.search({ ...payload })

Payload

Contact details

Retrieve a contact by its ID.

chat.contacts.retrieve(contactId)

Updating contacts

Update a contact by its ID.

chat.contacts.update(contactId, payload)

Payload

Name
wid
Type
string
Description
WhatsApp integration
Name
mid
Type
string
Description
Messenger integration

Deleting contacts

Delete a contact by its ID.

chat.contacts.delete(contactId)
Name
contactId
Type
string
Description

Get started with Chatness this afternoon

Each subscription goes towards aggressively adding new features built with customers' best interests at heart, including your privacy.

© 2024 Chatness - A product by IntenseloopChatness uptime in the last 180 days