Telegram Web K’s production build is a fully static site: HTML, JS, CSS, and WebAssembly assets written to aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TelegramOrg/Telegram-web-k/llms.txt
Use this file to discover all available pages before exploring further.
public/ directory. Once built, you can serve it from any static host — a CDN, an nginx vhost, GitHub Pages, or the Express server included in the repository.
Build pipeline
Thebuild script chains two steps: changelog generation and a Vite compile.
generate-changelog— reads commit history and writesCHANGELOG.mdandCHANGELOG_ru.md.vite build— bundles the application into thedist/directory, then the post-build logic inbuild.jscopies the output intopublic/, cleaning up stale files from previous builds.
Source maps are always included in production builds (
sourcemap: true in vite.config.ts). This is intentional — they make it easier to debug issues reported against the live app without shipping unminified code.Full build with version bump
For releases, usenode build instead of pnpm build. This orchestrates a broader pipeline:
Format the language pack
node build starts by running pnpm run format-lang to normalize the translation files.Apply updated language strings
pnpm run apply-new-lang pulls the latest language pack and returns a version number used in the next step.Bump the app version
pnpm run change-version records the new version and changelog reference in the app source. You can also pass a version and changelog argument explicitly:Deploy to a static host
Copy the contents ofpublic/ to the document root of any web server:
Serve with the bundled Express server
The repository includesserver.js, a small Express app that serves public/ with gzip compression and no caching headers. Use it for quick self-hosted deployments.
pnpm serve runs pnpm build first and then starts server.js. The server listens on port 80 by default.
Advanced server options
server.js accepts positional arguments for finer control:
| Argument | Values | Description |
|---|---|---|
tour | 3 | Serve from public3/ on port 8443 instead of public/ on port 80 |
port | any number | Override the default port |
protocol | https | Enable HTTPS mode (requires certs/server-key.pem and certs/server-cert.pem) |
3000 over HTTP:
443 over HTTPS:
For HTTPS mode, place your certificate files at
certs/server-key.pem and certs/server-cert.pem before starting the server.Web server configuration tips
Because the app is a single-page application, configure your web server to fall back toindex.html for any path that does not match a static file.
index.html:
Production domain and hardcoded credentials
When the app is served fromweb.telegram.org or webk.telegram.org, the isMainDomain flag is set to true at runtime and the app switches to a fixed set of API credentials regardless of .env.local:
isMainDomain is always false and the credentials from VITE_API_ID / VITE_API_HASH in .env.local are used instead.