OpenUI

Channels

Render OpenUI Lang as native, interactive messages in Slack, Microsoft Teams, Discord, Telegram, and WhatsApp.

Channels lets your agent answer in chat platforms with native, interactive cards instead of markdown. The model writes one OpenUI Lang program, and @openuidev/channels compiles it to each platform's own message format: field grids, buttons, forms, tables, and charts that work where your users already are.

Supported platforms

PlatformRenders toEntry point
SlackBlock Kit@openuidev/channels/slack
Microsoft TeamsAdaptive Cards 1.5@openuidev/channels/teams
DiscordComponents V2@openuidev/channels/discord
TelegramRich messages@openuidev/channels/telegram
WhatsAppInteractive messages@openuidev/channels/whatsapp

On Slack, cards stream into the thread while the model writes them.

How it works

  • One program, every platform. The model writes OpenUI Lang. Each entry point gives you a system prompt for its platform and compiles the program to that platform's payload.
  • Clicks don't call the model. The program's $variables are the card's state. When a user clicks a button or submits a form, the package re-renders the same program with the new state and updates the message.
  • Data comes from your tools. Query() and Mutation() in the program call your own tools, so cards show live data.
  • Bring your own transport. The package never owns webhooks, tokens, or delivery. Use it with Bolt, Vercel's Chat SDK, Bot Framework, or raw HTTP.

Install

pnpm add @openuidev/channels

Quickstart

A Slack bot that answers every mention with a streamed, interactive card. It uses Bolt in Socket Mode and calls the model through OpenUI Gateway with the AI SDK:

import { App } from "@slack/bolt";
import { streamText } from "ai";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { createSlackUI } from "@openuidev/channels/slack";

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  appToken: process.env.SLACK_APP_TOKEN,
  socketMode: true,
});
const gateway = createOpenAICompatible({
  name: "openui",
  baseURL: "https://api.thesys.dev/v1/embed",
  apiKey: process.env.THESYS_API_KEY,
});
const ui = createSlackUI();

app.event("app_mention", async ({ event, client }) => {
  const { textStream } = streamText({
    model: gateway("openai/gpt-5.5"),
    system: ui.prompt,
    prompt: event.text,
  });
  await ui.streamCard(client, { channel: event.channel, thread_ts: event.ts }, textStream);
});

await app.start();

For Teams, Discord, Telegram, and WhatsApp, and for wiring up button clicks, tools, and charts, see the @openuidev/channels API reference.

On this page