Teact
Getting started

Installation

Install Bun (recommended), scaffold with create-teact or the teact CLI, and add @teactjs packages to an existing project.

Prerequisites

  • Bun (recommended for bun dev / HMR) or Node 20+ if you use npm/pnpm.
  • A Telegram bot token from @BotFather.
bun create teact my-bot
cd my-bot

The wizard asks for:

  • Project name (if not passed as my-bot)
  • Template — Starter, Showcase, Counter, or Empty
  • Features — storage, conversations, streaming, auth, i18n, payments (varies by template)
  • Package manager — bun, npm, or pnpm
  • Install dependencies — usually yes

Then add your token to .env:

# .env
TELEGRAM_BOT_TOKEN=123456:ABC-DEF...

Start development:

bun dev

CLI equivalents

If you install the CLI globally or use bunx:

teact create my-bot
teact dev
teact build

See CLI for all commands (generate, doctor, flags).

Existing project

Add the core engine, the components package, and the Telegram adapter:

bun add @teactjs/core @teactjs/ui @teactjs/telegram

Optional add-ons: @teactjs/storage (persistence), @teactjs/plugin-sdk (author plugins), @teactjs/testing (dev/test).

Import components (Message, Button, InlineKeyboard, …) from @teactjs/ui. Import createBot, the router, hooks, and defineConfig from @teactjs/core. The old @teactjs/react, @teactjs/runtime, and @teactjs/renderer packages no longer exist — they were folded into @teactjs/core.

Verify

  • teact doctor — environment and project checks.
  • Send /start to your bot after bun dev — you should see your root component or router home route.

On this page