ConversationContext
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:16
Context for a conversation event and its client.
Extends
Section titled “Extends”ClientContext<ContentTypes>
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”ContentTypes
Section titled “ContentTypes”ContentTypes = unknown
ConversationType
Section titled “ConversationType”ConversationType extends Conversation = Conversation
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConversationContext<
ContentTypes,ConversationType>(__namedParameters):ConversationContext<ContentTypes,ConversationType>
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:23
Create a context for a conversation.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”client
Section titled “client”Client<ContentTypes>
The client that owns the conversation.
conversation
Section titled “conversation”ConversationType
The conversation that emitted the event.
Returns
Section titled “Returns”ConversationContext<ContentTypes, ConversationType>
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”client
Section titled “client”Get Signature
Section titled “Get Signature”get client():
Client<ContentTypes>
Defined in: sdks/js/agent-sdk/src/core/ClientContext.ts:23
Return the wrapped XMTP client.
Returns
Section titled “Returns”Client<ContentTypes>
Inherited from
Section titled “Inherited from”conversation
Section titled “conversation”Get Signature
Section titled “Get Signature”get conversation():
ConversationType
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:59
Return the conversation that triggered this context.
Returns
Section titled “Returns”ConversationType
isAllowed
Section titled “isAllowed”Get Signature
Section titled “Get Signature”get isAllowed():
boolean
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:64
Whether the conversation consent state is allowed.
Returns
Section titled “Returns”boolean
isDenied
Section titled “isDenied”Get Signature
Section titled “Get Signature”get isDenied():
boolean
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:69
Whether the conversation consent state is denied.
Returns
Section titled “Returns”boolean
isUnknown
Section titled “isUnknown”Get Signature
Section titled “Get Signature”get isUnknown():
boolean
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:74
Whether the conversation consent state is unknown.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”getClientAddress()
Section titled “getClientAddress()”getClientAddress():
string|undefined
Defined in: sdks/js/agent-sdk/src/core/ClientContext.ts:18
Return the account identifier used by the client, when available.
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”ClientContext.getClientAddress
isDm()
Section titled “isDm()”isDm():
this is ConversationContext<ContentTypes, Dm<ContentTypes>>
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:37
Narrow this context to a direct-message conversation.
Returns
Section titled “Returns”this is ConversationContext<ContentTypes, Dm<ContentTypes>>
isGroup()
Section titled “isGroup()”isGroup():
this is ConversationContext<ContentTypes, Group<ContentTypes>>
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:42
Narrow this context to a group conversation.
Returns
Section titled “Returns”this is ConversationContext<ContentTypes, Group<ContentTypes>>
sendRemoteAttachment()
Section titled “sendRemoteAttachment()”sendRemoteAttachment(
unencryptedFile,uploadCallback):Promise<void>
Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:47
Encrypt and send a remote attachment through the supplied upload callback.
Parameters
Section titled “Parameters”unencryptedFile
Section titled “unencryptedFile”File
uploadCallback
Section titled “uploadCallback”Returns
Section titled “Returns”Promise<void>

