initializeB24Frame(options?: {
version?: ApiVersion
restrictionParams?: Partial<RestrictionParams>
httpOptions?: TypeHttpOptions
}): Promise<B24Frame>
The initializeB24Frame function is designed to initialize a B24Frame object, which is used for working with Bitrix24 applications.
It manages the initialization process and handles potential connection errors.
Supports repeated calls until initialization is complete: every caller shares a single in-flight promise, so concurrent calls await one handshake and a resolved value is returned instantly. The first call wins: a later caller's
options are ignored and the already-built frame is returned, so pass restrictionParams / httpOptions at the app's first init rather than at a call site that may run second.If the app is opened outside the Bitrix24 iframe (a direct URL, a dev server, the install screen),
window.name carries no DOMAIN/APP_SID. The promise then rejects promptly with an SdkError (code: JSSDK_CLIENT_SIDE_WARNING, status: 500) instead of hanging — including every concurrent caller sharing that promise — and a later call may retry once the app runs inside Bitrix24. Always await inside try/catch.Parameters
options?— optional configuration:restrictionParams?: Partial<RestrictionParams>— rate-limit / retry tuning forwarded to the frame's HTTP transports (the same knobs assetRestrictionManagerParams). Omit to use the defaults. Example:initializeB24Frame({ restrictionParams: { retryOnNetworkError: false } }).httpOptions?: TypeHttpOptions— axios settings merged over the SDK's own defaults for both transports, forwarded to the constructor unchanged. The key it exists for isadapter: in a browser the SDK asks forfetch, because axios would otherwise walk['xhr', 'http', 'fetch']and take XHR by list order. Example:initializeB24Frame({ httpOptions: { adapter: 'xhr' } }). See Configuring the axios instance.version?: ApiVersion— reserved; accepted by the type but not yet consumed by the frame, so it currently has no effect.
Return Value
Promise<B24Frame>: Returns a promise that resolves to aB24Frameobject upon successful initialization.
Usage
import { initializeB24Frame } from '@bitrix24/b24jssdk'
Introduction
Designed for managing Bitrix24 applications running inside a placement iframe. Inherits from AbstractB24 and exposes managers for authentication, parent-window messaging, sliders, dialogs, placements, and options.
Auth
Designed for managing authentication in Bitrix24 applications. It handles authentication data received from the parent window and provides methods for updating and retrieving this data.