Conversations
Defined in: sdks/js/browser-sdk/src/Conversations.ts:36
Manages conversations
This class is not intended to be initialized directly.
Type Parameters
Section titled “Type Parameters”ContentTypes
Section titled “ContentTypes”ContentTypes = unknown
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Conversations<
ContentTypes>(client,worker,codecRegistry):Conversations<ContentTypes>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:47
Creates a new conversations instance
Parameters
Section titled “Parameters”client
Section titled “client”Client<ContentTypes>
worker
Section titled “worker”WorkerBridge<ClientWorkerAction>
The worker bridge instance for client communication
codecRegistry
Section titled “codecRegistry”The codec registry instance
Returns
Section titled “Returns”Conversations<ContentTypes>
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get topic():
string|undefined
Defined in: sdks/js/browser-sdk/src/Conversations.ts:57
Returns
Section titled “Returns”string | undefined
Methods
Section titled “Methods”beginningDeliveryCursor()
Section titled “beginningDeliveryCursor()”beginningDeliveryCursor():
Promise<DeliveryCursor>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:531
Returns
Section titled “Returns”Promise<DeliveryCursor>
createDm()
Section titled “createDm()”createDm(
inboxId,options?):Promise<Dm<ContentTypes>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:358
Creates a new DM conversation with the specified inbox ID
Parameters
Section titled “Parameters”inboxId
Section titled “inboxId”string
Inbox ID for the DM recipient
options?
Section titled “options?”Optional DM creation options
Returns
Section titled “Returns”Promise<Dm<ContentTypes>>
Promise that resolves with the new DM
createDmWithIdentifier()
Section titled “createDmWithIdentifier()”createDmWithIdentifier(
identifier,options?):Promise<Dm<ContentTypes>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:331
Creates a new DM conversation with the specified identifier
Parameters
Section titled “Parameters”identifier
Section titled “identifier”Identifier for the DM recipient
options?
Section titled “options?”Optional DM creation options
Returns
Section titled “Returns”Promise<Dm<ContentTypes>>
Promise that resolves with the new DM
createGroup()
Section titled “createGroup()”createGroup(
inboxIds,options?):Promise<Group<ContentTypes>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:307
Creates a new group conversation with the specified inbox IDs
Parameters
Section titled “Parameters”inboxIds
Section titled “inboxIds”string[]
Array of inbox IDs for other group members (the creator is included automatically)
options?
Section titled “options?”Optional group creation options
Returns
Section titled “Returns”Promise<Group<ContentTypes>>
Promise that resolves with the new group
createGroupOptimistic()
Section titled “createGroupOptimistic()”createGroupOptimistic(
options?):Promise<Group<ContentTypes>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:257
Creates a new group conversation without publishing to the network
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional group creation options
Returns
Section titled “Returns”Promise<Group<ContentTypes>>
Promise that resolves with the new group
createGroupWithIdentifiers()
Section titled “createGroupWithIdentifiers()”createGroupWithIdentifiers(
identifiers,options?):Promise<Group<ContentTypes>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:280
Creates a new group conversation with the specified identifiers
Parameters
Section titled “Parameters”identifiers
Section titled “identifiers”Array of identifiers for group members
options?
Section titled “options?”Optional group creation options
Returns
Section titled “Returns”Promise<Group<ContentTypes>>
Promise that resolves with the new group
fetchDmByIdentifier()
Section titled “fetchDmByIdentifier()”fetchDmByIdentifier(
identifier):Promise<Dm<unknown> |undefined>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:157
Fetches a DM by identifier
Parameters
Section titled “Parameters”identifier
Section titled “identifier”The identifier to look up
Returns
Section titled “Returns”Promise<Dm<unknown> | undefined>
Promise that resolves with the DM, if found
getConversationById()
Section titled “getConversationById()”getConversationById(
id):Promise<Group<ContentTypes> |Dm<ContentTypes> |undefined>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:91
Retrieves a conversation by its ID
Parameters
Section titled “Parameters”string
The conversation ID to look up
Returns
Section titled “Returns”Promise<Group<ContentTypes> | Dm<ContentTypes> | undefined>
Promise that resolves with the conversation, if found
getDmByInboxId()
Section titled “getDmByInboxId()”getDmByInboxId(
inboxId):Promise<Dm<unknown> |undefined>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:142
Retrieves a DM by inbox ID
Parameters
Section titled “Parameters”inboxId
Section titled “inboxId”string
The inbox ID to look up
Returns
Section titled “Returns”Promise<Dm<unknown> | undefined>
Promise that resolves with the DM, if found
getMessageById()
Section titled “getMessageById()”getMessageById(
id):Promise<DecodedMessage<ContentTypes> |undefined>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:127
Retrieves a message by its ID
Parameters
Section titled “Parameters”string
The message ID to look up
Returns
Section titled “Returns”Promise<DecodedMessage<ContentTypes> | undefined>
Promise that resolves with the decoded message, if found
hmacKeys()
Section titled “hmacKeys()”hmacKeys():
Promise<HmacKeys>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:377
Gets the HMAC keys for all conversations
Returns
Section titled “Returns”Promise<HmacKeys>
Promise that resolves with the HMAC keys for all conversations
list()
Section titled “list()”list(
options?):Promise<(Group<ContentTypes> |Dm<ContentTypes>)[]>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:173
Lists all conversations with optional filtering
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional filtering and pagination options
Returns
Section titled “Returns”Promise<(Group<ContentTypes> | Dm<ContentTypes>)[]>
Promise that resolves with an array of conversations
listDms()
Section titled “listDms()”listDms(
options?):Promise<Dm<ContentTypes>[]>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:235
Lists all DM conversations with optional filtering
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<ListConversationsOptions, "conversationType">
Optional filtering and pagination options
Returns
Section titled “Returns”Promise<Dm<ContentTypes>[]>
Promise that resolves with an array of DMs
listGroups()
Section titled “listGroups()”listGroups(
options?):Promise<Group<ContentTypes>[]>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:208
Lists all group conversations with optional filtering
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<ListConversationsOptions, "conversationType">
Optional filtering and pagination options
Returns
Section titled “Returns”Promise<Group<ContentTypes>[]>
Promise that resolves with an array of groups
messageHistorySnapshot()
Section titled “messageHistorySnapshot()”messageHistorySnapshot(
limit,options?):Promise<MessageHistorySnapshot>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:520
Parameters
Section titled “Parameters”number
options?
Section titled “options?”consentStates?
Section titled “consentStates?”conversationType?
Section titled “conversationType?”groupIds?
Section titled “groupIds?”string[]
Returns
Section titled “Returns”Promise<MessageHistorySnapshot>
stream()
Section titled “stream()”stream<
T>(options?):Promise<AsyncStreamProxy<T>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:388
Creates a stream for new conversations
Type Parameters
Section titled “Type Parameters”T extends Group<ContentTypes> | Dm<ContentTypes> = Group<ContentTypes> | Dm<ContentTypes>
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<SafeConversation, T> & object
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<T>>
Stream instance for new conversations
streamAllDmMessages()
Section titled “streamAllDmMessages()”streamAllDmMessages(
options?):Promise<MessageStream<DecodedMessage|undefined,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:565
Reads retained DM messages with default progress or an explicit replay cursor.
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>
Stream instance for new DM messages
streamAllGroupMessages()
Section titled “streamAllGroupMessages()”streamAllGroupMessages(
options?):Promise<MessageStream<DecodedMessage|undefined,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:542
Reads retained group messages with default progress or an explicit replay cursor.
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>
Stream instance for new group messages
streamAllMessages()
Section titled “streamAllMessages()”streamAllMessages(
options?):Promise<MessageStream<DecodedMessage|undefined,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:487
Reads retained messages after each group’s default acknowledgement position.
Set from to replay after a cursor without changing default progress.
Set onValue for callback mode, or request items with the iterator.
Core owns network recovery. Legacy retry options and disableSync do not apply.
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>
Stream instance for new messages
streamDeletedMessages()
Section titled “streamDeletedMessages()”streamDeletedMessages(
options?):Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:624
Creates a stream for deleted messages that streams the deleted messages
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>>, "onFail" | "onRestart" | "onRetry" | "retryAttempts" | "retryDelay" | "retryOnFail" | "disableSync">
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>
Stream instance for deleted messages
streamDms()
Section titled “streamDms()”streamDms(
options?):Promise<AsyncStreamProxy<Dm<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:469
Creates a stream for new DM conversations
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<SafeConversation, Dm<ContentTypes>>
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Dm<ContentTypes>>>
Stream instance for new DM conversations
streamGroups()
Section titled “streamGroups()”streamGroups(
options?):Promise<AsyncStreamProxy<Group<ContentTypes>>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:454
Creates a stream for new group conversations
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<SafeConversation, Group<ContentTypes>>
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Group<ContentTypes>>>
Stream instance for new group conversations
streamMessageDeletions()
Section titled “streamMessageDeletions()”streamMessageDeletions(
options?):Promise<AsyncStreamProxy<string>>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:589
Creates a stream for message deletions that streams the message IDs of deleted messages
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<StreamOptions<DecodedMessage, string>, "onFail" | "onRestart" | "onRetry" | "retryAttempts" | "retryDelay" | "retryOnFail" | "disableSync">
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<string>>
Stream instance for message deletions
sync()
Section titled “sync()”sync():
Promise<void>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:68
Synchronizes conversations for the current client from the network
Returns
Section titled “Returns”Promise<void>
Promise that resolves when sync is complete
syncAll()
Section titled “syncAll()”syncAll(
consentStates?):Promise<void>
Defined in: sdks/js/browser-sdk/src/Conversations.ts:79
Synchronizes all conversations and messages from the network with optional consent state filtering
Parameters
Section titled “Parameters”consentStates?
Section titled “consentStates?”Optional array of consent states to filter by
Returns
Section titled “Returns”Promise<void>
Promise that resolves when sync is complete

