To develop and test the Mini App outside of Telegram, use the dev:https script. This uses vite-plugin-mkcert to provide valid SSL certificates, which is necessary for certain features.
Note on SSL: When running dev:https for the first time, you may be prompted for your sudo password to configure the certificates. If you wish to avoid this, use npm run dev instead, but be aware that SSL is not configured.
Warning for Mobile Testing: Because the template uses self-signed SSL certificates in development, the Android and iOS Telegram applications will not be able to load the app due to strict security measures. For remote testing on mobile, refer to the Telegram platform guide.
Mocking the Telegram Environment: The template uses src/mockEnv.ts (imported in src/index.ts) which employs the mockTelegramEnv function. This simulates the Telegram environment so that libraries like @tma.js/sdk function correctly in a standard browser. Do not use this mock function in production.
npm run dev:https