Files
vercel__chat/README.md
Ben Sabic 90cd8f181a chore: refresh release workflow, community health files, and agent docs (#431)
* ci(release): pin changesets/action and enable npm provenance

Pin changesets/action to the v1.7.0 commit SHA, switch to GitHub-API
commit mode (signed commits via the API), set the version PR commit
and title to a conventional "chore(release): version packages", and
enable npm provenance attestations on publish via NPM_CONFIG_PROVENANCE.

* chore: add CODEOWNERS

Default ownership goes to @vercel/chat-sdk; release-plumbing paths
(release workflow, changeset config, CODEOWNERS itself) stay locked
to @cramforce since the publish workflow is bound to npm Trusted
Publisher by filename.

* docs: add SUPPORT.md and tidy issue contact links

Add a SUPPORT.md pointing users to docs, the issue chooser, and the
security advisory flow. Also update .github/config.yml: point the
Documentation contact link at chat-sdk.dev/docs (was a github.com
README anchor) and remove the GitHub Discussions entry, which 404s
because Discussions isn't enabled on the repo.

* chore: add docs issue and adapter request templates

Two new issue templates so reports come in pre-shaped:
- Documentation Issue — page/section, type (typo, outdated, missing,
  broken link, etc.), description, suggested fix.
- Adapter Request — platform name, adapter type (platform/state), API
  docs link, use case, existing community work, willingness to help
  maintain.

* docs(contributing): point contributors at issue templates and SUPPORT.md

Add a "Reporting issues" section at the top of CONTRIBUTING.md that
links to the issue chooser (now covering bugs, features, docs issues,
and adapter requests) and to SUPPORT.md for general questions, with
the SECURITY.md private-disclosure path called out separately.

* chore: add pre-merge checklist to PR template

Adds four self-attestation boxes contributors can tick before
requesting review, surfacing requirements that already live in
CONTRIBUTING.md so they're not forgotten:

- Signed and verified commits (CONTRIBUTING explicitly bounces PRs
  with unsigned commits).
- `pnpm validate` passes (lint, typecheck, tests, build in one go).
- Changeset added when a package's behavior changes.
- Docs updated for user-facing changes.

The "or N/A" wording on the last two avoids forcing a yes for
internal-only or docs-only PRs.

* chore: add Telegram and WhatsApp to bug report platform dropdown

The bug report platform dropdown was missing Telegram and WhatsApp,
which both have official adapters (@chat-adapter/telegram and
@chat-adapter/whatsapp). Reporters had to fall back to "Other" for
bugs in those adapters, losing the platform signal.

* docs(readme): fix CONTRIBUTING link path and add Support section

The Contributing section linked to ./CONTRIBUTING.md, but the file
actually lives at .github/CONTRIBUTING.md, so the link 404'd on
github.com. Repoint it.

Also add a Support section linking SUPPORT.md (general help) and
SECURITY.md (private vulnerability reporting) so those community
health files are reachable from the repo entry point instead of
only via GitHub's auto-surfacing.

* docs(contributing): add adapter authoring, commit conventions, and docs sections

Three additions to CONTRIBUTING.md to round out the file alongside
the recently added issue templates and PR checklist:

- "Building your own adapter" — points contributors who hit the
  Adapter Request template at the existing community-adapter guide
  on chat-sdk.dev rather than leaving them to discover it.
- "Commit messages" — codifies the Conventional Commits style the
  repo already uses; the release workflow now relies on the
  "chore(release): version packages" convention for its auto-PR,
  so consistency in new commits keeps changelogs predictable.
- "Updating documentation" — names the apps/docs/content/docs/
  source path, links the live site, and shows the local preview
  command so the PR-template "Documentation updated" checkbox is
  actionable.

* docs: trim agent docs, rename CLAUDE.md to AGENTS.md, add CLAUDE.md pointer

Move the agent guidance to AGENTS.md (the cross-tool convention) and
leave CLAUDE.md as a one-line "@AGENTS.md" pointer so Claude Code
keeps auto-loading the same content.

While renaming, trim and update the file:

- "packages/chat-sdk" was wrong — directory is "packages/chat", npm
  name is "chat".
- Updated the package list to include adapter-{discord,telegram,
  github,linear,zoom,shared}, state-{ioredis,pg}, integration-tests,
  and the apps/docs and examples/nextjs-chat trees.
- Replaced the verbose recording-and-replay jq walkthrough with a
  one-line pointer to the integration-tests README.
- Dropped the duplicated Changesets walkthrough — full guidance now
  lives in CONTRIBUTING.md.
- Condensed ~120 lines of generic Ultracite/Biome rules to a short
  list of non-obvious gotchas (Biome enforces the rest automatically).
- Added Conventional Commits (load-bearing for the release workflow's
  auto-PR), the apps/docs/content/docs/ docs path with the "pnpm
  --filter docs dev" preview command, a pointer to the community
  health files, and POSTGRES_URL/DATABASE_URL for the new state-pg
  adapter.

Net: 344 → ~125 lines.

* docs(nav): rename "Source" link to "GitHub"

---------

Co-authored-by: Ben Sabic <bensabic@users.noreply.github.com>
2026-04-27 05:22:35 -07:00

3.4 KiB

Chat SDK

npm version npm downloads License: MIT

A unified TypeScript SDK for building chat bots across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, and WhatsApp. Write your bot logic once, deploy everywhere.

Installation

npm install chat

Install adapters for your platforms:

npm install @chat-adapter/slack @chat-adapter/teams @chat-adapter/gchat @chat-adapter/discord @chat-adapter/telegram

Usage

import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";
import { createRedisState } from "@chat-adapter/state-redis";

const bot = new Chat({
  userName: "mybot",
  adapters: {
    slack: createSlackAdapter(),
  },
  state: createRedisState(),
});

bot.onNewMention(async (thread) => {
  await thread.subscribe();
  await thread.post("Hello! I'm listening to this thread.");
});

bot.onSubscribedMessage(async (thread, message) => {
  await thread.post(`You said: ${message.text}`);
});

See the Getting Started guide for a full walkthrough.

Adapters

Browse official, vendor-official, and community adapters on chat-sdk.dev/adapters. A cross-platform feature matrix is available at chat-sdk.dev/docs/adapters.

Features

  • Event handlers — mentions, messages, reactions, button clicks, slash commands, modals
  • AI streaming — stream LLM responses with native Slack streaming and post+edit fallback
  • Cards — JSX-based interactive cards (Block Kit, Adaptive Cards, Google Chat Cards)
  • Actions — handle button clicks and dropdown selections
  • Modals — form dialogs with text inputs, dropdowns, and validation
  • Slash commands — handle /command invocations
  • Emoji — type-safe, cross-platform emoji with custom emoji support
  • File uploads — send and receive file attachments
  • Direct messages — initiate DMs programmatically
  • Ephemeral messages — user-only visible messages with DM fallback
  • Overlapping messages — queue, debounce, drop, or process concurrent messages on the same thread

AI coding agent support

If you use an AI coding agent like Claude Code, you can teach it about Chat SDK:

npx skills add vercel/chat

Documentation

Full documentation is available at chat-sdk.dev/docs.

Contributing

See CONTRIBUTING.md for development setup and the release process.

Support

For help or questions, see SUPPORT.md. To report a security vulnerability, see SECURITY.md.

License

MIT