Telegram Web K uses Vite under the hood, giving you fast hot module replacement and CSS source maps out of the box. The dev server listens on portDocumentation 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.
8080 by default and automatically rebuilds on every file change — no manual restarts needed.
Prerequisites
- Node.js 18 or later
- pnpm 9.15.3 or later (
npm install -g pnpm) - A Telegram API ID and API hash — obtain these from my.telegram.org
pnpm is enforced by a
preinstall hook. Running npm install or yarn install directly will fail.Setup
Install dependencies
Install all JavaScript dependencies with pnpm:This also copies
.env.local.example to .env.local and src/langPackLocalVersion.example.ts to src/langPackLocalVersion.ts on first run.Available URLs
| URL | Description |
|---|---|
http://localhost:8080/ | Main application entry point |
http://localhost:8080/?test=1 | Connect to Telegram test DCs |
http://localhost:8080/?debug=1 | Enable verbose logging |
http://localhost:8080/?noSharedWorker=1 | Disable Shared Worker (useful when debugging workers) |
http://localhost:8080/?http=1 | Force HTTPS transport to Telegram servers |
http://localhost:8080/?test=1&debug=1
Debug utilities
The dev build ships with source maps enabled for both JS and CSS (devSourcemap: true). Several global helpers are also available in the browser console:
showIconLibrary()— renders every SVG icon in the project so you can browse and copy icon names.- Classes bound to the global context are accessible by name in developer tools — check the source for the exact identifiers.
Taking local storage snapshots
Thesnapshot-server mini-app lets you capture and restore the full state of localStorage and IndexedDB without touching the main app. This is useful for reproducing bugs or sharing a specific app state.
Stop the main dev server
The snapshot server must run on the same port as the main app so the browser treats them as the same origin.
Open the snapshot UI
Navigate to
http://localhost:8080 and use the interface to take or load snapshots. Snapshots are saved to ./snapshot-server/snapshots/.SSL setup for the web.telegram.org domain
Some features (such as push notifications) are gated behind the production domain. To test them locally, you can pointweb.telegram.org to 127.0.0.1 and run the dev server over HTTPS with a signed certificate.
/etc/hosts:
vite.config.ts by setting USE_SSL = true and USE_SIGNED_CERTS = true. The dev server will restart on port 443 and use the certificate files from the certs/ directory.
When running on
web.telegram.org or webk.telegram.org, the app automatically switches to hardcoded production API credentials (App.isMainDomain = true) regardless of what is set in .env.local.