Preferences
Defined in: sdks/js/browser-sdk/src/Preferences.ts:21
Manages user preferences and consent states
This class is not intended to be initialized directly.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Preferences(
worker):Preferences
Defined in: sdks/js/browser-sdk/src/Preferences.ts:29
Creates a new preferences instance
Parameters
Section titled “Parameters”worker
Section titled “worker”WorkerBridge<ClientWorkerAction>
The worker bridge that manages preferences
Returns
Section titled “Returns”Preferences
Methods
Section titled “Methods”fetchInboxState()
Section titled “fetchInboxState()”fetchInboxState():
Promise<InboxState>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:53
Retrieves the latest inbox state of this client from the network
Returns
Section titled “Returns”Promise<InboxState>
Promise that resolves with the inbox state
fetchInboxStates()
Section titled “fetchInboxStates()”fetchInboxStates(
inboxIds):Promise<InboxState[]>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:79
Retrieves the latest inbox states for specified inbox IDs from the network
Parameters
Section titled “Parameters”inboxIds
Section titled “inboxIds”string[]
Array of inbox IDs to get state for
Returns
Section titled “Returns”Promise<InboxState[]>
Promise that resolves with the inbox states for the inbox IDs
getConsentState()
Section titled “getConsentState()”getConsentState(
entityType,entity):Promise<ConsentState>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:105
Retrieves consent state for a specific entity
Parameters
Section titled “Parameters”entityType
Section titled “entityType”Type of entity to get consent for
entity
Section titled “entity”string
Entity identifier
Returns
Section titled “Returns”Promise<ConsentState>
Promise that resolves with the consent state
getInboxStates()
Section titled “getInboxStates()”getInboxStates(
inboxIds):Promise<InboxState[]>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:66
Retrieves the current inbox states for specified inbox IDs from the local database
Parameters
Section titled “Parameters”inboxIds
Section titled “inboxIds”string[]
Array of inbox IDs to get state for
Returns
Section titled “Returns”Promise<InboxState[]>
Promise that resolves with the inbox states for the inbox IDs
inboxState()
Section titled “inboxState()”inboxState():
Promise<InboxState>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:42
Retrieves the current inbox state of this client from the local database
Returns
Section titled “Returns”Promise<InboxState>
Promise that resolves with the inbox state
setConsentStates()
Section titled “setConsentStates()”setConsentStates(
records):Promise<void>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:92
Updates consent states for multiple records
Parameters
Section titled “Parameters”records
Section titled “records”Consent[]
Array of consent records to update
Returns
Section titled “Returns”Promise<void>
Promise that resolves when consent states are updated
streamConsent()
Section titled “streamConsent()”streamConsent(
options?):Promise<AsyncStreamProxy<Consent[]>>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:121
Creates a stream of consent state updates
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Consent[]>>
Stream instance for consent updates
streamPreferences()
Section titled “streamPreferences()”streamPreferences(
options?):Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:151
Creates a stream of user preference updates
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<UserPreferenceUpdate[]>
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>
Stream instance for preference updates
sync()
Section titled “sync()”sync():
Promise<GroupSyncSummary>
Defined in: sdks/js/browser-sdk/src/Preferences.ts:33
Returns
Section titled “Returns”Promise<GroupSyncSummary>

