Examples
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.
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.
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.
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).
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.
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.
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 +B24Hookquick startjs/03-nuxt-frame— Nuxt +B24Frame(helper, Pull client, dialogs)js/05-node-hook— pure Node.js +B24Hookscriptjs/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.