Chat SDK brings agents to your users
Vercel released Chat SDK, a TypeScript library that enables AI agents to work across multiple chat platforms including Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, Linear, and WhatsApp from a single codebase. The SDK abstracts platform-specific differences through adapters, allowing developers to write agents once and deploy them everywhere without rewriting code.
In early March, we gave the entire organization a challenge: figure out how to multiply your output.
People created agents. Mostly chat bots, but dedicated ones, purpose-built for real workflow augmentation: the agents were doing things automatically that would otherwise be tedious and time consuming.
Initially people built individual interfaces for their agents, and AI SDK made that easy with out-of-the box model integrations and AI Elements to simplify UI design.
Then we hit a constraint. People wanted to interact with the agents in Slack, meaning everyone had to figure out how to integrate with Slack's API.
Then the problem got worse. Once the agents were in Slack, people wanted to integrate them with even more platforms, like Discord, Github, and even issue trackers like Linear. Each of those introduced a new integration adventure for every agent.
It hit us. Instead of asking people to come to agents, we needed to deliver agents to the places they were already working.
We realized we had made it easy for our teams to create agents, but we needed to make it easier to extend them for adoption across platforms.
This is true for every company. People are already using Microsoft Teams, WhatsApp, Telegram, and Google Chat, and agents need to be available in all of them.
That's exactly what the Chat SDK does: makes agents available across enterprise and consumer chat platforms.
Just like the AI SDK unified model provider APIs into a single interface, we built Chat SDK to abstract the quirks of messaging APIs into a simple framework for developers and their coding agents.
Developers no longer need to think about the way streaming might differ from one platform to the next, or how formatting, branching logic, or even reaction-handling should be tackled for individual APIs.
Chat SDK is a TypeScript library for building bots that work across Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, and Linear from a single codebase. The core package handles event routing and application logic. Platform-specific behavior is handled by adapters, so your handlers don't change when your deployment target does.chat
Here's what a basic bot looks like:
Each adapter auto-detects credentials from environment variables, so you can get started without any additional configuration. Switching from Slack to Discord means swapping the adapter, not rewriting the bot.
Platforms behave very differently from each other, and Chat SDK doesn't paper over those differences with false promises. Instead, it handles them in the adapter layer so your application code doesn't have to.
Take streaming. Slack has a native streaming path that renders bold, italic, lists, and other formatting in real time as the response arrives. Other platforms use a fallback streaming path, passing streamed text through each adapter's markdown-to-native conversion pipeline at each intermediate edit.
Before Chat SDK, those adapters received raw markdown strings, so users on Discord or Teams would see literal syntax until the final message resolved. Now that conversion happens automatically.**bold**
Table rendering follows the same pattern. The component gives you a composable API for rendering tables across every adapter. Pass in headers and rows, and Chat SDK figures out the rest. Slack renders Block Kit table blocks. Teams and Discord use GFM markdown tables. Google Chat uses monospace text widgets. Telegram converts tables to code blocks. GitHub and Linear continue to use their existing markdown pipelines.Table()
Cards, modals, and buttons work similarly.
You write the element once using JSX, and each adapter renders them in whatever format the platform supports natively. If a platform doesn't support a given element, it will fall back gracefully.
Even if your agent only targets Slack, Chat SDK still solves real problems. Channel and user names are automatically converted to clear text so your agent understands the context of the conversation.
This translation works in both directions. When the agent at-mentions somebody using clear text, Chat SDK ensures the notification actually triggers in Slack.
Agents require full context to be effective. Chat SDK automatically includes link preview content, referenced posts, and images directly in agent prompts. Additionally, while models generate standard markdown, Slack does not natively support it.
Chat SDK converts standard markdown to the Slack variant automatically. This conversion happens in real time, even when using Slack's native append-only streaming API.
The function accepts an AI SDK text stream directly, which means you can pipe a streaming LLM response to any chat platform without any additional wiring:post()
The adapter layer handles the platform-specific rendering of that stream, including live formatting where the platform supports it.
Thread subscriptions, distributed locks, and key-value cache state are handled through pluggable state adapters. Redis and ioredis have been available since launch. PostgreSQL is now supported as a production-ready option, so teams already running Postgres can persist bot state without adding Redis to their infrastructure.
The PostgreSQL adapter uses (node-postgres) with raw SQL and automatically creates the required tables on first connect. It supports TTL-based caching, distributed locking across multiple instances, and namespaced state via a configurable key prefix.pg
Chat SDK now supports WhatsApp, extending the write-once model to one of the largest messaging platforms in the world.
The WhatsApp adapter supports messages, reactions, auto-chunking, read receipts, multi-media downloads (images, voice messages, stickers), and location sharing with Google Maps URLs. Cards render as interactive reply buttons with up to three options, falling back to formatted text where needed.
Note that WhatsApp enforces a 24-hour messaging window, so bots can only respond within that period. The adapter does not support message history, editing, or deletion.
To augment your coding agents, install the Chat skill:
And you can also modify and use this starter prompt:
The covers getting started, platform adapter setup, state configuration, and a with templates and guides.Chat SDK documentationresources library
Chat SDK is open source and in public beta. The agents your team has been building don't have to live on just one platform. They can go where your users actually are.
Chat needs integration abstraction
Write once, deploy everywhere
Platform inconsistencies, handled
Why Chat SDK matters even for single platforms
AI streaming, built in
State that scales
WhatsApp, and beyond
Getting started
Source: original entry ↗
More from Vercel
Follow Vercel to get its new changes in your feed and email digest.
OpenAI Decisions API now available on AI Gateway
OpenAI's Decisions API is now accessible through Vercel's AI Gateway with an OpenAI-compatible endpoint, enabling decision models to answer typed questions and return probabilities, choices, and scores for routing, triage, and guardrails use cases. Support is available across the OpenAI SDK, AI SDK, HTTP API, and CLI with the latest versions.
Timestamp attributes now supported in Vercel Flags
Vercel Flags now supports timestamp attributes for entities, allowing you to create time-based targeting rules. Use this feature to run limited-time campaigns, show content between specific dates, or target users based on registration date.
Glyph Cluster now available in stealth on AI Gateway
Glyph Cluster, a reasoning model for coding and long-context analysis, is now available as a stealth model on Vercel's AI Gateway for Pro and Enterprise plan teams with purchased AI Gateway credits at no cost during the stealth period. The model supports function calling, streams responses, and can be accessed via AI SDK, OpenAI-compatible APIs, and coding agents.