Skip to content

Dm

Defined in: sdks/js/browser-sdk/src/Dm.ts:12

Represents a direct message conversation between two inboxes

This class is not intended to be initialized directly.

ContentTypes = unknown

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

Defined in: sdks/js/browser-sdk/src/Dm.ts:25

Creates a new direct message conversation instance

WorkerBridge<ClientWorkerAction>

The worker bridge instance for client communication

CodecRegistry

The codec registry instance

string

Identifier for the direct message conversation

SafeConversation

Optional conversation data to initialize with

Dm<ContentTypes>

Conversation.constructor

get addedByInboxId(): string | undefined

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

string | undefined

Conversation.addedByInboxId


get createdAt(): Date | undefined

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

Date | undefined

Conversation.createdAt


get createdAtNs(): bigint | undefined

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

bigint | undefined

Conversation.createdAtNs


get id(): string

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

string

Conversation.id


get metadata(): GroupMetadata | undefined

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

GroupMetadata | undefined

Conversation.metadata


get topic(): string

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

string

Conversation.topic

beginningDeliveryCursor(): Promise<DeliveryCursor>

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

Promise<DeliveryCursor>

Conversation.beginningDeliveryCursor


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

Conversation.consentState


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

Conversation.countMessages


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

Conversation.debugInfo


duplicateDms(): Promise<Dm<ContentTypes>[]>

Defined in: sdks/js/browser-sdk/src/Dm.ts:48

Promise<Dm<ContentTypes>[]>


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

Conversation.hmacKeys


isActive(): Promise<boolean>

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

Promise<boolean>

Conversation.isActive


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

Conversation.isMessageDisappearingEnabled


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

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

Promise<DecodedMessage<ContentTypes> | undefined>

Conversation.lastMessage


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)

Conversation.lastReadTimes


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

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

Conversation.messageDisappearingSettings


messageHistorySnapshot(limit): Promise<MessageHistorySnapshot>

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

number

Promise<MessageHistorySnapshot>

Conversation.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

Conversation.messages


pausedForVersion(): Promise<string | undefined>

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

Promise<string | undefined>

Conversation.pausedForVersion


peerInboxId(): Promise<string>

Defined in: sdks/js/browser-sdk/src/Dm.ts:42

Retrieves the inbox ID of the other participant in the DM

Promise<string>

Promise that resolves with the peer’s inbox ID


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

Conversation.processStreamedMessage


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

Conversation.publishMessages


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

Conversation.removeMessageDisappearingSettings


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

Conversation.send


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

Conversation.sendActions


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

Conversation.sendAttachment


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

Conversation.sendIntent


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

Conversation.sendMarkdown


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

Conversation.sendMultiRemoteAttachment


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

Conversation.sendReaction


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

Conversation.sendReadReceipt


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

Conversation.sendRemoteAttachment


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

Conversation.sendReply


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

Conversation.sendText


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

Conversation.sendTransactionReference


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

Conversation.sendWalletSendCalls


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

Conversation.stream


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

Conversation.sync


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

Conversation.updateConsentState


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

Conversation.updateMessageDisappearingSettings