v1.2.0

Examples

Recipes that pair the SDK with realistic scenarios — CRM analytics, mass messaging, AI assistants, OAuth installs, and more. Each recipe is a single, copy-paste-friendly file.

This section collects task-shaped examples of using @bitrix24/b24jssdk. Most are runnable TypeScript files that double as agent skills — the same source lives under skills/b24jssdk-recipes/examples/ and is loaded by AI coding tools (Claude Code, Cursor, Copilot) as authoritative SDK context. Every recipe is type-checked in CI via pnpm run skills:typecheck.

Cookbook

Curated entry points — each recipe ships environment variables, an expected output sketch, and a Limitations block.

Webhook CLI smoke test

Verify a freshly created inbound webhook in 30 lines. Always start here.

Export deals to CSV

Stream every deal in a date window into a CSV using actions.v2.fetchList.make. Memory stays flat regardless of result size.

Bulk update deals

Migrate thousands of deals to a new stage using BatchByChunkV2.make() with partial-error handling.

Frame app skeleton

A minimum viable Vue 3 iframe app: handshake, parent title, persisted options, slider open/close.

Subscribe to Pull events

Live events in a frame app via useB24Helper and the Pull client (WebSocket + long-polling).

Extended catalogue

End-to-end TypeScript scripts — run with tsx after setting B24_HOOK to your incoming webhook URL.

CRM analytics — sales funnel

Stream all deals via actions.v2.fetchList.make, group by stage, print a funnel report.

Mass messaging

Filter contacts, personalise a template, send IM notifications to assigned managers.

Task automation on stage transitions

Poll deal stages every 60 s. When a watched transition fires, create a task with deadline and priority.

ERP / 1C contact sync

Two-way contact sync between Bitrix24 and an external ERP. Match by INN (primary) or email (fallback).

Disk — storages, folders, files

List storages and folder children, create subfolders, inspect files.

Telegram bot for new deals

Poll new CRM deals every two minutes; notify a Telegram chat with an HTML-formatted card.

Outbound webhook handler

Express server that receives Bitrix24 outbound events, fetches details via REST, dispatches by event name.

AI assistant — analyse a deal, create a follow-up task

Load a deal and its activities, ask GPT-4o for the next-best action, create a task bound to the deal.

Web search + LLM with timeline write-back

Two-step RAG: ask any web-search provider, run the result through your LLM, post the answer as a CRM timeline comment.

Error-handling cookbook

The four error layers (SdkError / AjaxError / network / soft) and the hardErrorCodes / softErrorCodes / retryOnNetworkError knobs.

Outbound event registration

CLI tool — list, bind, and unbind Bitrix24 outbound webhook events via event.get / event.bind / event.unbind.

OAuth install handshake

Express server that handles ONAPPINSTALL / ONAPPUPDATE / ONAPPUNINSTALL, persists tokens per portal, builds B24OAuth on demand.

UI showcases

Bitrix24 UI components paired with the SDK — these examples live in the b24sdk-examples repository.

Entity List with Pagination

Render a paged Bitrix24 entity list using B24Card, B24Table, B24Pagination, and the callList action.

App Installation Wizard

Build a multi-step install screen that runs scope-bound REST calls and wraps up with a confetti animation.

Node + Hook Company Export

Server-side script that exports companies into a CSV file using B24Hook, LoggerFactory, and Text.toDateTime.

Repository

All runnable examples live in two places:

  • skills/b24jssdk-recipes/examples/ — the 12 Extended catalogue recipes as TypeScript scripts, type-checked in CI.
  • bitrix24/b24sdk-examples — paired UI showcases (Nuxt, React) and the original Node/Hook starter scripts. Notable folders:
    • js/02-nuxt-hook — Nuxt + B24Hook quick start
    • js/03-nuxt-frame — Nuxt + B24Frame (helper, Pull client, dialogs)
    • js/05-node-hook — pure Node.js + B24Hook script
    • js/04-react-frame — React + B24Frame

Contributing

Found a missing recipe? Open an issue in bitrix24/b24jssdk. Pull requests against the SDK-native recipes go to this repository (under skills/b24jssdk-recipes/examples/); pull requests against the UI showcases go to bitrix24/b24sdk-examples.