Skip to content

Conversations

Defined in: sdks/js/node-sdk/src/Conversations.ts:34

Manages conversations

This class is not intended to be initialized directly.

ContentTypes = unknown

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

Defined in: sdks/js/node-sdk/src/Conversations.ts:46

Creates a new conversations instance

Client<ContentTypes>

The client instance managing the conversations

CodecRegistry

The codec registry instance

Conversations

The underlying conversations instance

Conversations<ContentTypes>

get topic(): string

Defined in: sdks/js/node-sdk/src/Conversations.ts:56

string

beginningDeliveryCursor(): DeliveryCursor

Defined in: sdks/js/node-sdk/src/Conversations.ts:491

DeliveryCursor


createDm(inboxId, options?): Promise<Dm<ContentTypes>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:224

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

The new DM

https://docs.xmtp.org/sdk/conversations/#create-a-dm


createDmWithIdentifier(identifier, options?): Promise<Dm<ContentTypes>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:200

Creates a new DM conversation with the specified identifier

Identifier

Identifier for the DM recipient

CreateDmOptions

Optional DM creation options

Promise<Dm<ContentTypes>>

The new DM

https://docs.xmtp.org/sdk/conversations/#create-a-dm


createGroup(inboxIds, options?): Promise<Group<ContentTypes>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:182

Creates a new group conversation with the specified inbox IDs

string[]

Array of inbox IDs for group members

CreateGroupOptions

Optional group creation options

Promise<Group<ContentTypes>>

The new group

https://docs.xmtp.org/sdk/conversations/#create-a-group


createGroupOptimistic(options?): Group<ContentTypes>

Defined in: sdks/js/node-sdk/src/Conversations.ts:145

Creates a new group conversation without publishing to the network

CreateGroupOptions

Optional group creation options

Group<ContentTypes>

The new group

https://docs.xmtp.org/sdk/conversations/#optimistically-create-a-group


createGroupWithIdentifiers(identifiers, options?): Promise<Group<ContentTypes>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:158

Creates a new group conversation with the specified identifiers

Identifier[]

Array of identifiers for group members

CreateGroupOptions

Optional group creation options

Promise<Group<ContentTypes>>

The new group

https://docs.xmtp.org/sdk/conversations/#create-a-group


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:113

Retrieves a DM by identifier

Identifier

The identifier to look up

Promise<Dm<ContentTypes> | undefined>

Promise that resolves with the DM, if found

https://docs.xmtp.org/sdk/conversations/


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:67

Retrieves a conversation by its ID

string

The conversation ID to look up

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

The conversation if found, undefined otherwise

https://docs.xmtp.org/sdk/conversations/


getDmByInboxId(inboxId): Dm<ContentTypes> | undefined

Defined in: sdks/js/node-sdk/src/Conversations.ts:96

Retrieves a DM by inbox ID

string

The inbox ID to look up

Dm<ContentTypes> | undefined

The DM if found, undefined otherwise

https://docs.xmtp.org/sdk/conversations/


getMessageById(id): DecodedMessage<ContentTypes> | undefined

Defined in: sdks/js/node-sdk/src/Conversations.ts:128

Retrieves a message by its ID

string

The message ID to look up

DecodedMessage<ContentTypes> | undefined

The decoded message if found, undefined otherwise

https://docs.xmtp.org/sdk/conversations/


hmacKeys(): Record<string, HmacKey[]>

Defined in: sdks/js/node-sdk/src/Conversations.ts:605

Gets the HMAC keys for all conversations

Record<string, HmacKey[]>

The HMAC keys for all conversations

https://docs.xmtp.org/sdk/push-notifications/


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:241

Lists all conversations with optional filtering

ListConversationsOptions

Optional filtering and pagination options

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

Array of conversations

https://docs.xmtp.org/sdk/conversations/


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:297

Lists all DMs with optional filtering

Omit<ListConversationsOptions, "conversationType">

Optional filtering and pagination options

Dm<ContentTypes>[]

Array of DMs

https://docs.xmtp.org/sdk/conversations/


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:275

Lists all groups with optional filtering

Omit<ListConversationsOptions, "conversationType">

Optional filtering and pagination options

Group<ContentTypes>[]

Array of groups

https://docs.xmtp.org/sdk/conversations/


messageHistorySnapshot(limit, options?): MessageHistorySnapshot

Defined in: sdks/js/node-sdk/src/Conversations.ts:475

number

ConsentState[]

ConversationType

string[]

MessageHistorySnapshot


stream(options?): Promise<AsyncStreamProxy<Group<ContentTypes> | Dm<ContentTypes>>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:342

Creates a stream for new conversations

StreamOptions<Conversation, Group<ContentTypes> | Dm<ContentTypes> | undefined> & object

Optional stream options

Promise<AsyncStreamProxy<Group<ContentTypes> | Dm<ContentTypes>>>

Stream instance for new conversations

https://docs.xmtp.org/sdk/stream/#stream-methods


streamAllDmMessages(options?): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:525

Reads retained DM messages with default progress or an explicit replay cursor.

StreamOptions<Message, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Stream instance for new DM messages

https://docs.xmtp.org/sdk/stream/#stream-methods


streamAllGroupMessages(options?): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:503

Reads retained group messages with default progress or an explicit replay cursor.

StreamOptions<Message, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Stream instance for new group messages

https://docs.xmtp.org/sdk/stream/#stream-methods


streamAllMessages(options?): Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:450

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<Message, DecodedMessage<ContentTypes>> & object

Optional stream options

Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>

Stream instance for new messages

https://docs.xmtp.org/sdk/stream/#stream-methods


streamDeletedMessages(options?): Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:578

Creates a stream for message deletions that streams the deleted messages

This is a local stream, does not require network sync, and will not fail like other streams.

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

Optional stream options

Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>

Stream instance for message deletions


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:421

Creates a stream for new DM conversations

StreamOptions<Conversation, Dm<ContentTypes>>

Optional stream options

Promise<AsyncStreamProxy<Dm<ContentTypes>>>

Stream instance for new DM conversations

https://docs.xmtp.org/sdk/stream/#stream-methods


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

Defined in: sdks/js/node-sdk/src/Conversations.ts:391

Creates a stream for new group conversations

StreamOptions<Conversation, Group<ContentTypes>>

Optional stream options

Promise<AsyncStreamProxy<Group<ContentTypes>>>

Stream instance for new group conversations

https://docs.xmtp.org/sdk/stream/#stream-methods


streamMessageDeletions(options?): Promise<AsyncStreamProxy<string>>

Defined in: sdks/js/node-sdk/src/Conversations.ts:550

Creates a stream for message deletions that streams the message IDs of deleted messages

This is a local stream, does not require network sync, and will not fail like other streams.

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/node-sdk/src/Conversations.ts:318

Synchronizes conversations for the current client from the network

Promise<void>

Promise that resolves when sync is complete

https://docs.xmtp.org/sdk/sync/


syncAll(consentStates?): Promise<GroupSyncSummary>

Defined in: sdks/js/node-sdk/src/Conversations.ts:330

Synchronizes all conversations and messages from the network with optional consent state filtering

ConsentState[]

Optional array of consent states to filter by

Promise<GroupSyncSummary>

Promise that resolves when sync is complete

https://docs.xmtp.org/sdk/sync/