v2.0.0

B24Frame Initialization

Function is designed to initialize a B24Frame
initializeB24Frame(options?: {
  version?: ApiVersion
  restrictionParams?: Partial<RestrictionParams>
}): 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.
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 as setRestrictionManagerParams). Omit to use the defaults. Example: initializeB24Frame({ restrictionParams: { retryOnNetworkError: false } }).
    • 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 a B24Frame object upon successful initialization.

Usage

import { initializeB24Frame } from '@bitrix24/b24jssdk'