Skip to content

Overview

TMA.sh is the deployment platform for Telegram Mini Apps. Push your code to GitHub, and TMA.sh automatically builds, deploys, and configures your Telegram bot. Your static SPA is served from a global CDN at {project}.tma.sh, ready for users in seconds.

Think of it as deployment-first infrastructure for Telegram Mini Apps — git-based deploys with auth, payments, storage, and bot routing built in.

Every project deployed to TMA.sh includes:

  • Automatic builds — push to main and your app is live. No CI config required.
  • Global CDN — static assets served from edge locations worldwide.
  • Built-in auth — validate Telegram users and get signed JWTs from initData. Works with Supabase, Firebase, Turso, or any backend.
  • Payments — accept TON and Telegram Stars with a few lines of code via @tma.sh/sdk.
  • KV storage — simple key-value storage scoped per project. No database setup needed.
  • Preview environments — select one pull request as your staging target and deploy it to pr{number}--yourapp.tma.sh, with optional preview-bot support.
  • Instant rollback — revert to any previous deployment with zero downtime.
  • Custom domains — bring your own domain with automatic SSL.
  • Edge API routes — add a server/api/index.ts file and get an API deployed to {project}--api.tma.sh. Works with any framework that exports a standard fetch handler (Hono, itty-router, or plain Web API).
  • Static SPA hosting at {project}.tma.sh with immutable deployments and route-based rollback.
  • Optional edge API routes at {project}--api.tma.sh, plus same-origin /api/* proxying on project and preview hosts.
  • Telegram auth and JWTs through @tma.sh/sdk (initData validation + JWKS verification path).
  • Project-scoped data with built-in KV and optional managed D1 (Pro/Team).
  • Preview environments tied to one selected staging PR (pr{number}--{project}.tma.sh).

TMA.sh builds and deploys static SPAs only. Common setups:

FrameworkNotes
ViteReact, Vue, Svelte
AstroStatic output mode
Plain HTMLNo build step required

The tma init command provides scaffold templates for Vite React, Vite Vue, Vite Svelte, and Plain HTML. Astro projects can be deployed by linking an existing Astro repository with tma link and configuring build settings in the dashboard if needed.

SSR frameworks like Next.js, Nuxt, and SvelteKit are not supported. TMA.sh serves static files from a CDN — if you need server-side rendering, those frameworks are not a fit. Use Vite with your preferred UI library instead.

Before you start, make sure you have:

  • Bun — the JavaScript runtime. Install from bun.sh.
  • A Telegram bot token — create one via @BotFather in Telegram.
  • A GitHub repository — TMA.sh deploys from GitHub. Public or private repos both work.

Go from zero to a linked local project in a few commands:

Terminal window
bun add -g @tma.sh/cli
tma init my-app
cd my-app
tma link
tma dev

Then connect your GitHub repository in the dashboard and push to your deploy branch (usually main) to trigger your first production deployment.

See Installation for detailed setup instructions, or jump straight to Your First Deploy for a step-by-step walkthrough.