react
vite
SWC
- bundler and more@twa.js/sdk-react
ngrok
– for developing environment@swan-io/chicane
- router with Typescripttailwind
- styling framework (opinionated, but I want to use it)
npm install
npm run dev
npm build
- Install ngrok https://ngrok.com/docs/getting-started#step-2-install-the-ngrok-agent
ngrok config add-authtoken TOKEN
with your token from ngrok dashboard- run
ngrok http 5173
, where 5173 is the port of your launched site in dev mode - Setup menu button in BotFather
- send
/setmenubutton
- pass link, that was generated by ngrok
- set some name for you menu button
- send
- Wait for changes in your bot (around 5-30 seconds)
- Launch web app in your bot
- Agree with ngrok info page (press the button)
- Turn on console in your tg client
- First way: via tg app settings
- Click 5-10 times in Settings button in tg app
- Turn on Web App Debug mode
- Second way: use eruda (https://github.com/liriliri/eruda)
- add to head in index.html
<script src="https://cdn.jsdelivr.net/npm/[email protected]/eruda.min.js"></script>
- turn it on by
(window as any).eruda.init();
(somehow, mb in index.html)
- add to head in index.html
- First way: via tg app settings