v1.1.0

Node.js Project

Guide for installing Bitrix24 JS SDK in Node.js applications.
We are still updating this page. Some data may be missing here — we will complete it shortly.

Add to a Node.js project

Since version 0.4.0 CommonJs is not supported. Only ESM and UMD.

Before you begin, make sure you have the latest version of Node.js installed.

We support version Node.js ^18.0.0 || ^20.0.0 || >=22.0.0

Then run the following command to install the library:

Install the Bitrix24 JS SDK package

pnpm add @bitrix24/b24jssdk

Import

Import the library into your project:

import { LoggerFactory } from '@bitrix24/b24jssdk'

Init

The B24Hook object is intended exclusively for use on the server.
  • A webhook contains a secret access key, which MUST NOT be used in client-side code (browser, mobile app).
  • For the client side, use B24Frame

To work with Bitrix24 from a standalone server-side application, use the B24Hook object.

import { B24Hook } from '@bitrix24/b24jssdk'

// 1. Get the webhook URL from Bitrix24:
//    - Go to Bitrix24
//    - Settings → Developers → Webhooks
//    - Create a new webhook with the required permissions
//    - Copy the URL in the format: https://your-domain.bitrix24.com/rest/1/your-token/

// 2. Initialize B24Hook
const $b24 = B24Hook.fromWebhookUrl('https://your-domain.bitrix24.com/rest/1/your-token/')

// 3. Use API methods