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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Preferences(
client,conversations):Preferences
Defined in: sdks/js/node-sdk/src/Preferences.ts:29
Creates a new preferences instance
Parameters
Section titled “Parameters”client
Section titled “client”Client
The client instance managing preferences
conversations
Section titled “conversations”Conversations
The underlying conversations instance
Returns
Section titled “Returns”Preferences
Methods
Section titled “Methods”fetchInboxState()
Section titled “fetchInboxState()”fetchInboxState():
Promise<InboxState>
Defined in: sdks/js/node-sdk/src/Preferences.ts:52
Retrieves the latest inbox state of this clientfrom 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/node-sdk/src/Preferences.ts:73
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/node-sdk/src/Preferences.ts:94
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/node-sdk/src/Preferences.ts:63
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/node-sdk/src/Preferences.ts:43
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(
consentStates):Promise<void>
Defined in: sdks/js/node-sdk/src/Preferences.ts:83
Updates consent states for multiple records
Parameters
Section titled “Parameters”consentStates
Section titled “consentStates”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/node-sdk/src/Preferences.ts:104
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/node-sdk/src/Preferences.ts:123
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/node-sdk/src/Preferences.ts:34
Returns
Section titled “Returns”Promise<GroupSyncSummary>

