Skip to content

dngpng/tg-mini-app-starter

Repository files navigation

Telegram Mini App Starter

This project is a starter for building Telegram Mini Apps using Next.js.

Demo

https://t.me/mini_app_starter_bot/app

Stack

Local Development

  1. Install dependencies:

    pnpm install
  2. Create a bot in Telegram (via @BotFather and using the command /newbot).

  3. Set the TG_API_TOKEN in .env to the API token of your bot.

  4. Configure a publicly accessible URL to your local machine using ngrok or cloudflare tunnel. If your public URL is http instead of https, refer to the docs to turn on test environment.

  5. Configure the bot using @BotFather and the command /newapp. Use the public URL you configured in the previous step as the "App link". This step will let you choose an App name, it can be used with the bot url to directly open the app. e.g. https://t.me/{bot_name}/{app_name}.

  6. Configure the bot's menu button to point to the mini app's URL.

  7. Run the development server:

    pnpm dev
  8. Open the mini app via either the Mini App's URL or the clicking on the menu button in the bot.

About

Starter template for building Telegram Mini Apps using Next.js.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published