Skip to content

Preferences

Defined in: sdks/js/node-sdk/src/Preferences.ts:19

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/src/Preferences.ts:29

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/src/Preferences.ts:52

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/src/Preferences.ts:73

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/src/Preferences.ts:94

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/src/Preferences.ts:63

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/src/Preferences.ts:43

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/src/Preferences.ts:83

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/src/Preferences.ts:104

Creates a stream of consent state updates

StreamOptions<Consent[]>

Optional stream options

Promise<AsyncStreamProxy<Consent[]>>

Stream instance for consent updates


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

Defined in: sdks/js/node-sdk/src/Preferences.ts:123

Creates a stream of user preference updates

StreamOptions<UserPreferenceUpdate[]>

Optional stream options

Promise<AsyncStreamProxy<UserPreferenceUpdate[]>>

Stream instance for preference updates


sync(): Promise<GroupSyncSummary>

Defined in: sdks/js/node-sdk/src/Preferences.ts:34

Promise<GroupSyncSummary>