Properties
string
Bot user ID for platforms that use IDs in mentions (e.g., Slack’s <@U123>)
Default lock scope for this adapter.
'thread'(default): lock per threadId'channel': lock per channelId (for channel-based platforms like WhatsApp, Telegram)
ChatConfig.lockScope.string
required
Unique name for this adapter (e.g., “slack”, “teams”)
boolean
boolean
When true, the SDK persists per-thread message history in the state
adapter for this platform. Use for platforms that lack server-side
message history APIs (e.g. WhatsApp, Telegram).
boolean
Whether active turns should be published for cross-process cancellation.
string
required
Bot username (can override global userName)
Methods
addReaction()
Parameters
string
required
string
required
string | EmojiValue
required
Type:
EmojiValueReturns
Promise<void>
channelIdFromThreadId()
Parameters
string
required
Returns
string
decodeThreadId()
Parameters
string
required
Returns
TThreadId
deleteMessage()
Parameters
string
required
string
required
Returns
Promise<void>
disconnect()
Returns
Promise<void>
editMessage()
Parameters
string
required
string
required
required
Returns
RawMessage
editObject()
Parameters
string
required
The thread containing the message
string
required
The message ID to edit
string
required
The object kind (e.g., “plan”)
unknown
required
The object data (type depends on kind)
Returns
RawMessage
encodeThreadId()
Parameters
TThreadId
required
Returns
string
endTyping()
Parameters
string
required
Returns
Promise<void>
fetchChannelInfo()
Parameters
string
required
Returns
ChannelInfo
fetchChannelMessages()
Parameters
string
required
Returns
FetchResult
fetchMessage()
Parameters
string
required
The thread ID containing the message
string
required
The platform-specific message ID
Returns
Message
The message, or null if not found/not supported
fetchMessages()
backward(default): Fetches the most recent messages. Use this for loading a chat view. ThenextCursorpoints to older messages.forward: Fetches the oldest messages first. Use this for iterating through message history. ThenextCursorpoints to newer messages.
Parameters
string
required
Returns
FetchResult
fetchSubject()
Parameters
TRawMessage
required
Returns
MessageSubject
fetchThread()
Parameters
string
required
Returns
ThreadInfo
getChannelVisibility()
Parameters
string
required
The thread ID to check
Returns
ChannelVisibility
The channel visibility scope
getUser()
Parameters
string
required
Platform-specific user ID
Returns
UserInfo
User info, or null if user not found
handleWebhook()
Parameters
Request
required
Returns
Promise<Response>
initialize()
Parameters
required
Returns
Promise<void>
isDM()
Parameters
string
required
The thread ID to check
Returns
boolean
True if the thread is a DM, false otherwise
listThreads()
Parameters
string
required
Returns
ListThreadsResult
markAsRead()
Thread.markAsRead() throws NotImplementedError when an
adapter leaves this out. The full message is passed alongside its ID when
the caller has one, so adapters can read platform data off message.raw
instead of resolving the ID themselves.
Parameters
string
required
Thread containing the message
string
required
ID of the message to acknowledge
Returns
Promise<void>
onThreadSubscribe()
Parameters
string
required
Returns
Promise<void>
openDM()
Parameters
string
required
The platform-specific user ID
Returns
Promise<string>
The thread ID for the DM conversation
openModal()
Parameters
string
required
Platform-specific trigger ID from the action event
required
The modal element to display
string
Optional context ID for server-side stored thread/message context
Returns
Promise<{ viewId: string }>
The view/dialog ID
parseMessage()
Parameters
TRawMessage
required
Returns
Message
postChannelMessage()
Parameters
string
required
required
Returns
RawMessage
postEphemeral()
Parameters
string
required
The thread to post in
string
required
The user who should see the message
required
The message content
Returns
EphemeralMessage
EphemeralMessage with usedFallback indicating private delivery, or null if unsupported
postMessage()
Parameters
string
required
required
Returns
RawMessage
postObject()
Parameters
string
required
The thread to post to
string
required
The object kind (e.g., “plan”)
unknown
required
The object data (type depends on kind)
Returns
RawMessage
rehydrateAttachment()
Parameters
required
Returns
Attachment
removeReaction()
Parameters
string
required
string
required
string | EmojiValue
required
Type:
EmojiValueReturns
Promise<void>
renderFormatted()
Parameters
Returns
string
reply()
Parameters
string
required
string
required
required
Returns
RawMessage
scheduleMessage()
Parameters
string
required
The thread to post in
required
The message content
{ postAt: Date }
required
Scheduling options including the target delivery time
Returns
ScheduledMessage
A ScheduledMessage with cancel() capability
startTyping()
Parameters
string
required
string
Returns
Promise<void>
stream()
null before consuming any chunks to delegate back to
Chat SDK’s built-in post+edit fallback for the current thread.
The stream can yield plain strings (text chunks) or StreamChunk objects
for rich content like task progress cards. Adapters that don’t support structured
chunks will extract text from markdown_text chunks and ignore other types.
Parameters
string
required
The thread to stream to
AsyncIterable<string | StreamChunk>
required
Type:
StreamChunkAsync iterable of text chunks or structured StreamChunk objectsPlatform-specific streaming options
Returns
RawMessage
The raw message after streaming completes, or null to use core fallback