Skip to content

Conversation

Defined in: sdks/js/browser-sdk/src/Conversation.ts:37

Represents a conversation

This class is not intended to be initialized directly.

ContentTypes = unknown

new Conversation<ContentTypes>(worker, codecRegistry, id, data?): Conversation<ContentTypes>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:53

Creates a new conversation instance

WorkerBridge<ClientWorkerAction>

The worker bridge instance for client communication

CodecRegistry

The codec registry instance

string

The unique identifier for this conversation

SafeConversation

Optional conversation data to initialize with

Conversation<ContentTypes>

get addedByInboxId(): string | undefined

Defined in: sdks/js/browser-sdk/src/Conversation.ts:75

string | undefined


get createdAt(): Date | undefined

Defined in: sdks/js/browser-sdk/src/Conversation.ts:83

Date | undefined


get createdAtNs(): bigint | undefined

Defined in: sdks/js/browser-sdk/src/Conversation.ts:79

bigint | undefined


get id(): string

Defined in: sdks/js/browser-sdk/src/Conversation.ts:71

string


get metadata(): GroupMetadata | undefined

Defined in: sdks/js/browser-sdk/src/Conversation.ts:87

GroupMetadata | undefined


get topic(): string

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

string

beginningDeliveryCursor(): Promise<DeliveryCursor>

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

Promise<DeliveryCursor>


consentState(): Promise<ConsentState>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:405

Gets the consent state for this conversation

Promise<ConsentState>

Promise that resolves with the current consent state


countMessages(options?): Promise<bigint>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:390

Counts messages in this conversation

Omit<ListMessagesOptions, "limit" | "direction">

Optional filtering options

Promise<bigint>

Promise that resolves with the count of messages


debugInfo(): Promise<ConversationDebugInfo>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:546

Retrieves information for this conversation to help with debugging

Promise<ConversationDebugInfo>

The debug information for this conversation


hmacKeys(): Promise<HmacKeys>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:535

Gets HMAC keys for this conversation

Promise<HmacKeys>

Promise that resolves with the HMAC keys


isActive(): Promise<boolean>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:104

Promise<boolean>


isMessageDisappearingEnabled(): Promise<boolean>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:472

Checks if message disappearing is enabled for this conversation

Promise<boolean>

Promise that resolves with whether message disappearing is enabled


lastMessage(): Promise<DecodedMessage<ContentTypes> | undefined>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:95

Promise<DecodedMessage<ContentTypes> | undefined>


lastReadTimes(): Promise<LastReadTimes>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:558

Retrieves the last read times for this conversation

Promise<LastReadTimes>

A map keyed by inbox ID with the last read timestamp (nanoseconds since epoch)


members(): Promise<GroupMember[]>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:115

Gets the conversation members

Promise<GroupMember[]>

Promise that resolves with the conversation members


messageDisappearingSettings(): Promise<MessageDisappearingSettings | undefined>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:429

Gets the message disappearing settings for this conversation

Promise<MessageDisappearingSettings | undefined>

Promise that resolves with the current message disappearing settings


messageHistorySnapshot(limit): Promise<MessageHistorySnapshot>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:513

number

Promise<MessageHistorySnapshot>


messages(options?): Promise<DecodedMessage<ContentTypes>[]>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:372

Lists messages in this conversation

ListMessagesOptions

Optional filtering and pagination options

Promise<DecodedMessage<ContentTypes>[]>

Promise that resolves with an array of decoded messages


pausedForVersion(): Promise<string | undefined>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:524

Promise<string | undefined>


processStreamedMessage(envelopeBytes): Promise<Message[]>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:151

Decodes, decrypts, and persists a raw envelope from a group message stream.

Uint8Array

Raw protobuf-encoded envelope bytes from the stream

Promise<Message[]>

The processed and stored messages


publishMessages(): Promise<void>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:139

Publishes pending messages that were sent optimistically

Promise<void>

Promise that resolves when publishing is complete


removeMessageDisappearingSettings(): Promise<void>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:458

Removes message disappearing settings from this conversation

Promise<void>

Promise that resolves when the settings are removed


send(content, options?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:171

Sends a message

EncodedContent

The encoded content to send

SendMessageOpts

Optional send options

Promise<string>

Promise that resolves with the message ID after it has been sent


sendActions(actions, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:292

Sends an actions message

Actions

The actions to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendAttachment(attachment, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:322

Sends an attachment message

Attachment

The attachment to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendIntent(intent, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:307

Sends an intent message

Intent

The intent to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendMarkdown(markdown, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:201

Sends a markdown message

string

The markdown to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendMultiRemoteAttachment(multiRemoteAttachment, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:337

Sends a multi remote attachment message

MultiRemoteAttachment

The multi remote attachment to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendReaction(reaction, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:216

Sends a reaction message

Reaction

The reaction to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendReadReceipt(opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:230

Sends a read receipt message

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendRemoteAttachment(remoteAttachment, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:355

Sends a remote attachment message

RemoteAttachment

The remote attachment to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendReply(reply, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:244

Sends a reply message

Reply

The reply to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendText(text, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:186

Sends a text message

string

The text to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendTransactionReference(transactionReference, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:259

Sends a transaction reference message

TransactionReference

The transaction reference to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


sendWalletSendCalls(walletSendCalls, opts?): Promise<string>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:277

Sends a wallet send calls message

WalletSendCalls

The wallet send calls to send

SendOpts

Send options (optimistic delivery, idempotency key)

Promise<string>

Promise that resolves with the message ID after it has been sent


stream(options?): Promise<MessageStream<DecodedMessage | undefined, DecodedMessage<ContentTypes>>>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:487

Reads retained messages after the 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 delivery callbacks and replay cursor

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

Stream instance for new messages


sync(): Promise<SafeConversation>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:126

Synchronizes conversation data from the network

Promise<SafeConversation>

Promise that resolves with the updated conversation data


updateConsentState(state): Promise<void>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:417

Updates the consent state for this conversation

ConsentState

The new consent state to set

Promise<void>

Promise that resolves when the update is complete


updateMessageDisappearingSettings(fromNs, inNs): Promise<void>

Defined in: sdks/js/browser-sdk/src/Conversation.ts:442

Updates message disappearing settings for this conversation

bigint

The timestamp from which messages should start disappearing

bigint

The duration after which messages should disappear

Promise<void>

Promise that resolves when the update is complete