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.
What you get
Section titled “What you get”Every project deployed to TMA.sh includes:
- Automatic builds — push to
mainand 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.tsfile and get an API deployed to{project}--api.tma.sh. Works with any framework that exports a standardfetchhandler (Hono, itty-router, or plain Web API).
Most important pieces
Section titled “Most important pieces”- Static SPA hosting at
{project}.tma.shwith 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(initDatavalidation + 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).
Supported frameworks
Section titled “Supported frameworks”TMA.sh builds and deploys static SPAs only. Common setups:
| Framework | Notes |
|---|---|
| Vite | React, Vue, Svelte |
| Astro | Static output mode |
| Plain HTML | No 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.
Prerequisites
Section titled “Prerequisites”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.
Quick start
Section titled “Quick start”Go from zero to a linked local project in a few commands:
bun add -g @tma.sh/clitma init my-appcd my-apptma linktma devThen 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.