v2.2.0

TypeB24

Public contract implemented by every entry-point class (B24Frame, B24Hook, B24OAuth). Single source of truth for the SDK surface.

TypeB24 is the unified type implemented by B24Frame, B24Hook, and B24OAuth. Use it as a parameter type when your code shouldn't care which transport it talks to.

import type { TypeB24 } from '@bitrix24/b24jssdk'

async function listAdminTasks($b24: TypeB24): Promise<unknown[]> {
  const response = await $b24.actions.v2.callList.make<{ id: number, title: string }>({
    method: 'tasks.task.list',
    params: { filter: { '!=STATUS': '5' }, select: ['ID', 'TITLE'] },
    idKey: 'id', // tasks return lowercase id
    cursorIdKey: 'ID', // ...but sort / filter by uppercase ID
    customKeyForResult: 'tasks',
    requestId: 'admin-tasks'
  })
  return response.isSuccess ? response.getData()! : []
}

Shape

type TypeB24 = {
  readonly isInit: boolean
  init(): Promise<void>
  destroy(): void

  getLogger(): LoggerInterface
  setLogger(logger: LoggerInterface): void

  get auth(): AuthActions
  get actions(): ActionsManager
  get tools(): ToolsManager

  setRestrictionManagerParams(params: RestrictionParams): Promise<void>

  getTargetOrigin(): string
  getTargetOriginWithPath(): Map<ApiVersion, string>

  getHttpClient(version: ApiVersion): TypeHttp
  setHttpClient(version: ApiVersion, client: TypeHttp): void
}
Five members left this interface in 3.0.0.callMethod, callListMethod, fetchListMethod, callBatch and callBatchByChunk were shortcuts that ignored the restApi:v2 / restApi:v3 split; they are replaced by actions.v{2,3}.{call,callList,fetchList,batch,batchByChunk}.make(options). Four of the five are a mechanical swap; callListMethod is not — see the migration guide.