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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Preferences(
client,conversations):Preferences
Defined in: sdks/js/node-sdk/dist/index.d.ts:1189
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/dist/index.d.ts:1202
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/dist/index.d.ts:1217
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/dist/index.d.ts:1232
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/dist/index.d.ts:1210
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/dist/index.d.ts:1196
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/dist/index.d.ts:1224
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/dist/index.d.ts:1239
Creates a stream of consent state updates
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Consent[], Consent[]>
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/dist/index.d.ts:1246
Creates a stream of user preference updates
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<UserPreferenceUpdate[], 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/dist/index.d.ts:1190
Returns
Section titled “Returns”Promise<GroupSyncSummary>

