Conversations
Defined in: sdks/js/node-sdk/dist/index.d.ts:927
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,codecRegistry,conversations):Conversations<ContentTypes>
Defined in: sdks/js/node-sdk/dist/index.d.ts:936
Creates a new conversations instance
Parameters
Section titled “Parameters”client
Section titled “client”Client<ContentTypes>
The client instance managing the conversations
codecRegistry
Section titled “codecRegistry”The codec registry instance
conversations
Section titled “conversations”Conversations
The underlying conversations instance
Returns
Section titled “Returns”Conversations<ContentTypes>
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get topic():
string
Defined in: sdks/js/node-sdk/dist/index.d.ts:937
Returns
Section titled “Returns”string
Methods
Section titled “Methods”beginningDeliveryCursor()
Section titled “beginningDeliveryCursor()”beginningDeliveryCursor():
DeliveryCursor
Defined in: sdks/js/node-sdk/dist/index.d.ts:1104
Returns
Section titled “Returns”createDm()
Section titled “createDm()”createDm(
inboxId,options?):Promise<Dm<ContentTypes>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1013
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>>
The new DM
https://docs.xmtp.org/sdk/conversations/#create-a-dm
createDmWithIdentifier()
Section titled “createDmWithIdentifier()”createDmWithIdentifier(
identifier,options?):Promise<Dm<ContentTypes>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1004
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>>
The new DM
https://docs.xmtp.org/sdk/conversations/#create-a-dm
createGroup()
Section titled “createGroup()”createGroup(
inboxIds,options?):Promise<Group<ContentTypes>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:995
Creates a new group conversation with the specified inbox IDs
Parameters
Section titled “Parameters”inboxIds
Section titled “inboxIds”string[]
Array of inbox IDs for group members
options?
Section titled “options?”Optional group creation options
Returns
Section titled “Returns”Promise<Group<ContentTypes>>
The new group
https://docs.xmtp.org/sdk/conversations/#create-a-group
createGroupOptimistic()
Section titled “createGroupOptimistic()”createGroupOptimistic(
options?):Group<ContentTypes>
Defined in: sdks/js/node-sdk/dist/index.d.ts:977
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”Group<ContentTypes>
The new group
https://docs.xmtp.org/sdk/conversations/#optimistically-create-a-group
createGroupWithIdentifiers()
Section titled “createGroupWithIdentifiers()”createGroupWithIdentifiers(
identifiers,options?):Promise<Group<ContentTypes>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:986
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>>
The new group
https://docs.xmtp.org/sdk/conversations/#create-a-group
fetchDmByIdentifier()
Section titled “fetchDmByIdentifier()”fetchDmByIdentifier(
identifier):Promise<Dm<ContentTypes> |undefined>
Defined in: sdks/js/node-sdk/dist/index.d.ts:961
Retrieves a DM by identifier
Parameters
Section titled “Parameters”identifier
Section titled “identifier”The identifier to look up
Returns
Section titled “Returns”Promise<Dm<ContentTypes> | undefined>
Promise that resolves with the DM, if found
https://docs.xmtp.org/sdk/conversations/
getConversationById()
Section titled “getConversationById()”getConversationById(
id):Promise<Group<ContentTypes> |Dm<ContentTypes> |undefined>
Defined in: sdks/js/node-sdk/dist/index.d.ts:945
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>
The conversation if found, undefined otherwise
https://docs.xmtp.org/sdk/conversations/
getDmByInboxId()
Section titled “getDmByInboxId()”getDmByInboxId(
inboxId):Dm<ContentTypes> |undefined
Defined in: sdks/js/node-sdk/dist/index.d.ts:953
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”Dm<ContentTypes> | undefined
The DM if found, undefined otherwise
https://docs.xmtp.org/sdk/conversations/
getMessageById()
Section titled “getMessageById()”getMessageById(
id):DecodedMessage<ContentTypes> |undefined
Defined in: sdks/js/node-sdk/dist/index.d.ts:969
Retrieves a message by its ID
Parameters
Section titled “Parameters”string
The message ID to look up
Returns
Section titled “Returns”DecodedMessage<ContentTypes> | undefined
The decoded message if found, undefined otherwise
https://docs.xmtp.org/sdk/conversations/
hmacKeys()
Section titled “hmacKeys()”hmacKeys():
Record<string,HmacKey[]>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1159
Gets the HMAC keys for all conversations
Returns
Section titled “Returns”Record<string, HmacKey[]>
The HMAC keys for all conversations
https://docs.xmtp.org/sdk/push-notifications/
list()
Section titled “list()”list(
options?):Promise<(Group<ContentTypes> |Dm<ContentTypes>)[]>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1021
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>)[]>
Array of conversations
https://docs.xmtp.org/sdk/conversations/
listDms()
Section titled “listDms()”listDms(
options?):Dm<ContentTypes>[]
Defined in: sdks/js/node-sdk/dist/index.d.ts:1037
Lists all DMs with optional filtering
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<ListConversationsOptions, "conversationType">
Optional filtering and pagination options
Returns
Section titled “Returns”Dm<ContentTypes>[]
Array of DMs
https://docs.xmtp.org/sdk/conversations/
listGroups()
Section titled “listGroups()”listGroups(
options?):Group<ContentTypes>[]
Defined in: sdks/js/node-sdk/dist/index.d.ts:1029
Lists all groups with optional filtering
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<ListConversationsOptions, "conversationType">
Optional filtering and pagination options
Returns
Section titled “Returns”Group<ContentTypes>[]
Array of groups
https://docs.xmtp.org/sdk/conversations/
messageHistorySnapshot()
Section titled “messageHistorySnapshot()”messageHistorySnapshot(
limit,options?):MessageHistorySnapshot
Defined in: sdks/js/node-sdk/dist/index.d.ts:1099
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”stream()
Section titled “stream()”stream(
options?):Promise<AsyncStreamProxy<Group<ContentTypes> |Dm<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1062
Creates a stream for new conversations
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Conversation, Group<ContentTypes> | Dm<ContentTypes> | undefined> & object
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Group<ContentTypes> | Dm<ContentTypes>>>
Stream instance for new conversations
https://docs.xmtp.org/sdk/stream/#stream-methods
streamAllDmMessages()
Section titled “streamAllDmMessages()”streamAllDmMessages(
options?):Promise<MessageStream<Message,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1126
Reads retained DM messages with default progress or an explicit replay cursor.
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Message, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>
Stream instance for new DM messages
https://docs.xmtp.org/sdk/stream/#stream-methods
streamAllGroupMessages()
Section titled “streamAllGroupMessages()”streamAllGroupMessages(
options?):Promise<MessageStream<Message,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1113
Reads retained group messages with default progress or an explicit replay cursor.
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Message, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>
Stream instance for new group messages
https://docs.xmtp.org/sdk/stream/#stream-methods
streamAllMessages()
Section titled “streamAllMessages()”streamAllMessages(
options?):Promise<MessageStream<Message,DecodedMessage<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1093
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<Message, DecodedMessage<ContentTypes>> & object
Optional stream options
Returns
Section titled “Returns”Promise<MessageStream<Message, DecodedMessage<ContentTypes>>>
Stream instance for new messages
https://docs.xmtp.org/sdk/stream/#stream-methods
streamDeletedMessages()
Section titled “streamDeletedMessages()”streamDeletedMessages(
options?):Promise<AsyncStreamProxy<DecodedMessage<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1152
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.
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 message deletions
streamDms()
Section titled “streamDms()”streamDms(
options?):Promise<AsyncStreamProxy<Dm<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1080
Creates a stream for new DM conversations
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Conversation, Dm<ContentTypes>>
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Dm<ContentTypes>>>
Stream instance for new DM conversations
https://docs.xmtp.org/sdk/stream/#stream-methods
streamGroups()
Section titled “streamGroups()”streamGroups(
options?):Promise<AsyncStreamProxy<Group<ContentTypes>>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1072
Creates a stream for new group conversations
Parameters
Section titled “Parameters”options?
Section titled “options?”StreamOptions<Conversation, Group<ContentTypes>>
Optional stream options
Returns
Section titled “Returns”Promise<AsyncStreamProxy<Group<ContentTypes>>>
Stream instance for new group conversations
https://docs.xmtp.org/sdk/stream/#stream-methods
streamMessageDeletions()
Section titled “streamMessageDeletions()”streamMessageDeletions(
options?):Promise<AsyncStreamProxy<string>>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1142
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.
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/node-sdk/dist/index.d.ts:1044
Synchronizes conversations for the current client from the network
Returns
Section titled “Returns”Promise<void>
Promise that resolves when sync is complete
https://docs.xmtp.org/sdk/sync/
syncAll()
Section titled “syncAll()”syncAll(
consentStates?):Promise<GroupSyncSummary>
Defined in: sdks/js/node-sdk/dist/index.d.ts:1053
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<GroupSyncSummary>
Promise that resolves when sync is complete

