nextjs-tma-template
Example of Telegram Mini App developed with NextJS
nextjs-tma-template ist ein Open-Source-Projekt von Yaroslav Koval, hauptsächlich in TypeScript geschrieben und unter der Lizenz GPL-3.0 veröffentlicht. Letzte Aktualisierung: 30. Nov. 2026. Der Quellcode liegt auf GitHub.
- TypeScript
- javascript
- miniapp
- nextjs
- react
- Aktualisiert
- Lizenz
- GPL-3.0
- Sterne
- 0
git clone https://github.com/koval01/nextjs-tma-template.gitREADME
Die README wird in ihrer Originalsprache angezeigt.
Telegram Mini App Next.js Template
This template demonstrates how developers can implement a web application on the Telegram Mini Apps platform using the following technologies and libraries:
The template was created using pnpm. Therefore, it is required to use it for this project as well. Using other package managers, you will receive a corresponding error.
Install Dependencies
If you have just cloned this template, you should install the project dependencies using the command:
pnpm install
Scripts
This project contains the following scripts:
dev. Runs the application in development mode.dev:https. Runs the application in development mode using self-signed SSL certificate.build. Builds the application for production.start. Starts the Next.js server in production mode.lint. Runs eslint to ensure the code quality meets the required standards.deploy. Starting the build of the project, and in the case of a successful build, all commits will be pushed to the origin repository
To run a script, use the pnpm run command:
pnpm run {script}
# Example: pnpm run build
Create Bot and Mini App
Before you start, make sure you have already created a Telegram Bot. Here is a comprehensive guide on how to do it.
Run
Although Mini Apps are designed to be opened within Telegram applications, you can still develop and test them outside of Telegram during the development process.
To run the application in the development mode, use the dev script:
pnpm run dev
After this, you will see a similar message in your terminal:
▲ Next.js 14.2.3
- Local: http://localhost:3000
✓ Starting...
✓ Ready in 2.9s
To view the application, you need to open the Local link (http://localhost:3000 in this example) in your browser.
It is important to note that some libraries in this template, such as @tma.js/sdk, are not intended for use outside of Telegram.
Nevertheless, they appear to function properly. This is because the src/hooks/useTelegramMock.ts
[... continued on GitHub]