Skip to content

Preferences

Defined in: sdks/js/node-sdk/dist/index.d.ts:1181

Manages user preferences and consent states

This class is not intended to be initialized directly.

new Preferences(client, conversations): Preferences

Defined in: sdks/js/node-sdk/dist/index.d.ts:1189

Creates a new preferences instance

Client

The client instance managing preferences

Conversations

The underlying conversations instance

Preferences

fetchInboxState(): Promise<InboxState>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1202

Retrieves the latest inbox state of this clientfrom the network

Promise<InboxState>

Promise that resolves with the inbox state


fetchInboxStates(inboxIds): Promise<InboxState[]>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1217

Retrieves the latest inbox states for specified inbox IDs from the network

string[]

Array of inbox IDs to get state for

Promise<InboxState[]>

Promise that resolves with the inbox states for the inbox IDs


getConsentState(entityType, entity): Promise<ConsentState>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1232

Retrieves consent state for a specific entity

ConsentEntityType

Type of entity to get consent for

string

Entity identifier

Promise<ConsentState>

Promise that resolves with the consent state


getInboxStates(inboxIds): Promise<InboxState[]>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1210

Retrieves the current inbox states for specified inbox IDs from the local database

string[]

Array of inbox IDs to get state for

Promise<InboxState[]>

Promise that resolves with the inbox states for the inbox IDs


inboxState(): Promise<InboxState>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1196

Retrieves the current inbox state of this client from the local database

Promise<InboxState>

Promise that resolves with the inbox state


setConsentStates(consentStates): Promise<void>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1224

Updates consent states for multiple records

Consent[]

Array of consent records to update

Promise<void>

Promise that resolves when consent states are updated


streamConsent(options?): Promise<AsyncStreamProxy<Consent[]>>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1239

Creates a stream of consent state updates

StreamOptions<Consent[], Consent[]>

Optional stream options

Promise<AsyncStreamProxy<Consent[]>>

Stream instance for consent updates


streamPreferences(options?): Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1246

Creates a stream of user preference updates

StreamOptions<UserPreferenceUpdate[], UserPreferenceUpdate[]>

Optional stream options

Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>

Stream instance for preference updates


sync(): Promise<GroupSyncSummary>

Defined in: sdks/js/node-sdk/dist/index.d.ts:1190

Promise<GroupSyncSummary>