OptionsManager is created twice — once for app.option.get and once for user.option.get. Reachable through B24HelperManager.appOptions and B24HelperManager.userOptions. It treats option values as raw strings server-side and converts on read.
Usage
import { useB24Helper, LoadDataType } from '@bitrix24/b24jssdk'
const { initB24Helper, getB24Helper } = useB24Helper()
await initB24Helper($b24, [LoadDataType.AppOptions, LoadDataType.UserOptions])
const helper = getB24Helper()
// Read with a default
const filters = helper.userOptions.getJsonObject('listFilters', {})
const itemsPerPage = helper.userOptions.getInteger('itemsPerPage', 20)
// Persist
await helper.appOptions.save(
{ theme: 'dark' },
{ moduleId: 'main', command: 'optionsChanged', params: { theme: 'dark' } }
)
Typed Getters
Static Helpers
OptionsManager.getSupportTypes(): TypeOption[]
OptionsManager.prepareArrayList(list: any): any[]
TypeOption enumerates the supported value shapes (NotSet / JsonArray / JsonObject / FloatVal / IntegerVal / BoolYN / StringVal).
Cache Methods
get data(): Map<string, any>
reset(): void
data is the raw key→string map. reset() clears the in-memory cache without touching the server.
Save
save(
options: Record<string, any>,
optionsPull?: { moduleId: string, command: string, params: any },
requestId?: string
): Promise<Result>
Issues a single batched call:
app.option.setforappOptions/user.option.setforuserOptions, with the suppliedoptionspayload.- Optionally
pull.application.event.addso other clients are notified about the change.
Both calls share isHaltOnError: true. Returns the wrapping Result.
save() does not update the local cache. Call getB24Helper().loadData([LoadDataType.AppOptions]) (or rerun initB24Helper) if you need the new state to be visible to subsequent getX() reads.Encoding Helpers
encode(value: any): string // JSON.stringify wrapper
decode(data: string, defaultValue: any): any // JSON.parse with logged failure
Convenience wrappers around JSON.stringify / JSON.parse that log parse failures through the manager's logger.