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.
Usage
getTargetOrigin(): string
Returns the Bitrix24 address (e.g., https://your_domain.bitrix24.com/rest/1/xxx).
Similar function in BX24.js.
Example
import { B24Hook } from '@bitrix24/b24jssdk'
// Define the dev mode
const devMode = typeof import.meta !== 'undefined' && (import.meta.env?.DEV || import.meta.dev)
const $logger = LoggerFactory.createForBrowser('MyApp', devMode)
const $b24 = B24Hook.fromWebhookUrl('https://your_domain.bitrix24.com/rest/1/xxxx/')
$logger.info($b24.getTargetOriginWithPath()) // https://your_domain.bitrix24.com/rest/1/xxx
Next Steps
Core API methods:
- callMethod() — Call any REST API method
- callBatch() — Batch execution of up to 50 commands
Working with lists:
- callFastListMethod() — Automatic retrieval of all list pages
- fetchListMethod() — Incremental loading of large lists via generator
Advanced scenarios:
- callBatchByChunk() — Batch execution of any number of commands with automatic chunking