Skip to content

Conversations

Defined in: sdks/js/browser-sdk/src/Conversations.ts:36

Manages conversations

This class is not intended to be initialized directly.

ContentTypes = unknown

new Conversations<ContentTypes>(client, worker, codecRegistry): Conversations<ContentTypes>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:47

Creates a new conversations instance

Client<ContentTypes>

WorkerBridge<ClientWorkerAction>

The worker bridge instance for client communication

CodecRegistry

The codec registry instance

Conversations<ContentTypes>

get topic(): string | undefined

Defined in: sdks/js/browser-sdk/src/Conversations.ts:57

string | undefined

beginningDeliveryCursor(): Promise<DeliveryCursor>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:531

Promise<DeliveryCursor>


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

string

Inbox ID for the DM recipient

CreateDmOptions

Optional DM creation options

Promise<Dm<ContentTypes>>

Promise that resolves with the new DM


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

Identifier

Identifier for the DM recipient

CreateDmOptions

Optional DM creation options

Promise<Dm<ContentTypes>>

Promise that resolves with the new DM


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

string[]

Array of inbox IDs for other group members (the creator is included automatically)

CreateGroupOptions

Optional group creation options

Promise<Group<ContentTypes>>

Promise that resolves with the new group


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

CreateGroupOptions

Optional group creation options

Promise<Group<ContentTypes>>

Promise that resolves with the new group


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

Identifier[]

Array of identifiers for group members

CreateGroupOptions

Optional group creation options

Promise<Group<ContentTypes>>

Promise that resolves with the new group


fetchDmByIdentifier(identifier): Promise<Dm<unknown> | undefined>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:157

Fetches a DM by identifier

Identifier

The identifier to look up

Promise<Dm<unknown> | undefined>

Promise that resolves with the DM, if found


getConversationById(id): Promise<Group<ContentTypes> | Dm<ContentTypes> | undefined>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:91

Retrieves a conversation by its ID

string

The conversation ID to look up

Promise<Group<ContentTypes> | Dm<ContentTypes> | undefined>

Promise that resolves with the conversation, if found


getDmByInboxId(inboxId): Promise<Dm<unknown> | undefined>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:142

Retrieves a DM by inbox ID

string

The inbox ID to look up

Promise<Dm<unknown> | undefined>

Promise that resolves with the DM, if found


getMessageById(id): Promise<DecodedMessage<ContentTypes> | undefined>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:127

Retrieves a message by its ID

string

The message ID to look up

Promise<DecodedMessage<ContentTypes> | undefined>

Promise that resolves with the decoded message, if found


hmacKeys(): Promise<HmacKeys>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:377

Gets the HMAC keys for all conversations

Promise<HmacKeys>

Promise that resolves with the HMAC keys for all conversations


list(options?): Promise<(Group<ContentTypes> | Dm<ContentTypes>)[]>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:173

Lists all conversations with optional filtering

ListConversationsOptions

Optional filtering and pagination options

Promise<(Group<ContentTypes> | Dm<ContentTypes>)[]>

Promise that resolves with an array of conversations


listDms(options?): Promise<Dm<ContentTypes>[]>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:235

Lists all DM conversations with optional filtering

Omit<ListConversationsOptions, "conversationType">

Optional filtering and pagination options

Promise<Dm<ContentTypes>[]>

Promise that resolves with an array of DMs


listGroups(options?): Promise<Group<ContentTypes>[]>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:208

Lists all group conversations with optional filtering

Omit<ListConversationsOptions, "conversationType">

Optional filtering and pagination options

Promise<Group<ContentTypes>[]>

Promise that resolves with an array of groups


messageHistorySnapshot(limit, options?): Promise<MessageHistorySnapshot>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:520

number

ConsentState[]

ConversationType

string[]

Promise<MessageHistorySnapshot>


stream<T>(options?): Promise<AsyncStreamProxy<T>>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:388

Creates a stream for new conversations

T extends Group<ContentTypes> | Dm<ContentTypes> = Group<ContentTypes> | Dm<ContentTypes>

StreamOptions<SafeConversation, T> & object

Optional stream options

Promise<AsyncStreamProxy<T>>

Stream instance for new conversations


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.

StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>

Stream instance for new DM messages


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.

StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>

Stream instance for new group messages


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.

StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>

Stream instance for new messages


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

Omit<StreamOptions<DecodedMessage, DecodedMessage<ContentTypes>>, "onFail" | "onRestart" | "onRetry" | "retryAttempts" | "retryDelay" | "retryOnFail" | "disableSync">

Optional stream options

Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>

Stream instance for deleted messages


streamDms(options?): Promise<AsyncStreamProxy<Dm<ContentTypes>>>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:469

Creates a stream for new DM conversations

StreamOptions<SafeConversation, Dm<ContentTypes>>

Optional stream options

Promise<AsyncStreamProxy<Dm<ContentTypes>>>

Stream instance for new DM conversations


streamGroups(options?): Promise<AsyncStreamProxy<Group<ContentTypes>>>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:454

Creates a stream for new group conversations

StreamOptions<SafeConversation, Group<ContentTypes>>

Optional stream options

Promise<AsyncStreamProxy<Group<ContentTypes>>>

Stream instance for new group conversations


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

Omit<StreamOptions<DecodedMessage, string>, "onFail" | "onRestart" | "onRetry" | "retryAttempts" | "retryDelay" | "retryOnFail" | "disableSync">

Optional stream options

Promise<AsyncStreamProxy<string>>

Stream instance for message deletions


sync(): Promise<void>

Defined in: sdks/js/browser-sdk/src/Conversations.ts:68

Synchronizes conversations for the current client from the network

Promise<void>

Promise that resolves when sync is complete


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

ConsentState[]

Optional array of consent states to filter by

Promise<void>

Promise that resolves when sync is complete