
Chat SDK adds message subjects and direct SDK access
Quick Take
Chat SDK now supports message subjects and direct access to platform SDKs for enhanced bot functionality.
Key Points
- Read parent issues or pull requests in comments.
- Message subjects are cached for efficient access.
- Adapters expose underlying platform SDKs for direct API calls.
📖 Reader Mode
~2 min read1 min read
You can now read the parent issue or pull request when your bot is mentioned in a Linear or GitHub comment. message.subject resolves to that parent with title, status, URL, and the full typed payload.
lib/bot.ts
bot.onNewMention(async (thread, message) => {
const subject = await message.subject;
if (subject) {
await thread.post(
`This is about: ${subject.title} (${subject.status})\n${subject.url}`
);
}
});
Reply to a mention with the parent issue's title, status, and URL
message.subject is cached per message, so repeated access only hits the API once. It resolves to null on Slack and other chat platforms, where there's no parent resource.
Link to headingDirect access to platform SDKs
The GitHub, Linear, and Slack adapters now expose their underlying platform SDKs. Use them to extend your bot by calling provider APIs directly.
// Add a "triaged" label to issue #42
const { octokit } = bot.getAdapter("github");
await octokit.rest.issues.addLabels({ owner: "vercel", repo: "chat", issue_number: 42, labels: ["triaged"] });
// Create a new issue in a team
const { linearClient } = bot.getAdapter("linear");
await linearClient.createIssue({ teamId: "TEAM_ID", title: "Investigate flaky test" });
// Pin a message in a channel
const { webClient } = bot.getAdapter("slack");
await webClient.pins.add({ channel: "C123ABC", timestamp: "1234567890.123456" });
Add a GitHub label, create a Linear issue, or pin a Slack message
The previous .client getter remains as a @deprecated alias on the adapters.
Read the documentation to get started, or explore one of our templates.
The Complete Guide to Chat SDK
Learn how Chat SDK works end-to-end: from core concepts to building your first bot to deploying it across Slack, Teams, and more.
Read the guide
— Originally published at vercel.com
Want this in your inbox every morning?
Daily brief at your local 8am — bilingual EN/中文, free.


