Registry / communication / crisp-api

crisp-api

JSON →
library1.1.22jsnpmunverified

crisp-api is the official Node.js wrapper for the Crisp API, maintained directly by Crisp. It provides a comprehensive interface to interact with the Crisp platform's REST and WebSocket APIs, enabling developers to authenticate, manage conversations, send messages, access agent accounts, and build custom bots. The current stable version is 10.9.3, requiring Node.js 16.0.0 or higher. As an official library, it typically aligns closely with the latest API revisions (last updated 29/01/2026), offering stability and reliability for integrations. It differentiates itself by providing full API resource implementation, type definitions for TypeScript, and dedicated maintainer support from Crisp, ensuring it remains up-to-date with Crisp's evolving services.

npm install crisp-api
INSTALL
IMPORT
SIG · CRISP-API
C
crisp-api
communicationjavascriptv1.1.22
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Crisp
import { Crisp } from 'crisp-api';
import Crisp from 'crisp-api';
The main client class `Crisp` is a named export, not a default export.
Crisp (CommonJS)
const { Crisp } = require('crisp-api');
const Crisp = require('crisp-api');
Even in CommonJS, `Crisp` is a named export, requiring destructuring.
Crisp (Type)
import type { Crisp } from 'crisp-api';
Import the type for `Crisp` class if you're only using it in type annotations, common in TypeScript for tree-shaking benefits.

This quickstart demonstrates authenticating to the Crisp API with plugin credentials and fetching a list of conversations for a specified website ID.

import { Crisp } from 'crisp-api'; const identifier = process.env.CRISP_IDENTIFIER ?? ''; const key = process.env.CRISP_KEY ?? ''; const websiteID = process.env.CRISP_WEBSITE_ID ?? ''; async function main() { if (!identifier || !key || !websiteID) { console.error('Please set CRISP_IDENTIFIER, CRISP_KEY, and CRISP_WEBSITE_ID environment variables.'); process.exit(1); } const CrispClient = new Crisp(); try { // Authenticate with your plugin token keypair CrispClient.authenticateTier('plugin', identifier, key); console.log('Authenticated successfully.'); // List conversations for a specific website const conversations = await CrispClient.website.listConversations(websiteID, 1); console.log(`Successfully listed ${conversations.length} conversations for website ${websiteID}:`); conversations.forEach((conv: any) => { console.log(`- Conversation ID: ${conv.session_id}, Status: ${conv.status}, Last Message: ${conv.last_message_text}`); }); } catch (error: any) { console.error('Error interacting with Crisp API:', error.message); if (error.response) { console.error('API Response Data:', error.response.data); } } } main();
Debug
Known issues
breakingThe `crisp-api` package requires Node.js version 16.0.0 or higher. Earlier Node.js versions are not supported and may lead to runtime errors or unexpected behavior.
fix
Upgrade your Node.js environment to version 16.0.0 or a later compatible version.
affects: <16.0.0
gotchaAPI methods are restricted based on your authentication token tier (`user`, `website`, or `plugin`). Attempting to call a method not permitted by your token tier will result in an authorization error.
fix
Ensure you are using the correct token tier for the API operations you intend to perform. Refer to the Crisp API documentation for specific method permissions per tier.
affects: >=1.0.0
gotchaYour authentication token keypair (identifier and key) should be kept strictly private and stored securely. Exposing these credentials can compromise your Crisp account and data.
fix
Store your API credentials in environment variables or a secure secrets management system. Never hardcode them directly in your source code or commit them to version control.
affects: >=1.0.0
gotchaWhen using WebSocket event listeners (e.g., `CrispClient.on('message:send', ...) `), ensure that you have successfully authenticated the `CrispClient` instance *before* registering the event listener. Events will not be processed otherwise.
fix
Always call `CrispClient.authenticateTier()` and wait for its completion (e.g., using `await` or `.then()`) before setting up any `CrispClient.on()` event listeners.
affects: >=1.0.0
Errors
Common errors & fixes
ReferenceError: Crisp is not defined
Incorrect import statement, likely trying to use `require('crisp-api')` directly without destructuring, or using `import Crisp from 'crisp-api'` (default import) in an ESM context.
fix
For CommonJS, use `const { Crisp } = require('crisp-api');`. For ESM, use `import { Crisp } from 'crisp-api';`.
Error: Not Authorized (website)
Attempting to use an API method that is not permitted by the authentication token's tier (e.g., 'plugin' token trying to access 'user' specific methods) or using invalid credentials.
fix
Verify that your `identifier` and `key` are correct and that the `authenticateTier` ('plugin', 'user', 'website') matches the permissions required for the API call. Consult the Crisp API documentation for specific method permissions.
TypeError: CrispClient.on is not a function
This error occurs if you attempt to register a WebSocket event listener (e.g., `CrispClient.on`) before the client instance has been properly authenticated, or if the client instance itself is not correctly initialized.
fix
Ensure `CrispClient = new Crisp()` is called correctly, and critically, `CrispClient.authenticateTier()` completes successfully before any `CrispClient.on()` calls.
Upgrade
Version history
1.1.22latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources
crisp-api — npm install crisp-api · libregistry