Create a Telegram Mini-App using ThirdWeb SDK

This guide shows how to build a Telegram Mini-App using the ThirdWeb SDK on the Lux Testnet Network.

Back

Telegram Mini-Apps are a new way to build and deploy applications and games embedded in the Telegram platform. They are built using ThirdWeb, a platform that allows developers to connect and utilize both external and in-app wallets on the Lux network.

Learn more about ThirdWeb.

  • Basic understanding of Solidity and Typescript.
  • Basic understanding of Telegram Bots and the Telegram API.
  • Basic understanding of the Lux Testnet Testnet.

Getting started

Create a template from the ThirdWeb Telegram Mini-App Starter Kit by clicking the Use this template button on the top right.

IMPORTANT!! mark "Include all branches", otherwise Github pages deployment will not work.

Clone the new repository & install the dependencies

git clone <new-repo-url>
cd <new repo>
yarn install

Get the clientID from a ThirdWeb account on the ThirdWeb Dashboard

Create a .env file in the root of the project and add the clientID from the previous step:

VITE_THIRDWEB_CLIENT_ID=...

Run the project in development mode

yarn dev

On git push to the main branch, the project will be automatically deployed to Github Pages.

Follow the section below to link a Telegram Bot to the webapp.

Integrating with Telegram Bots

Create a new Telegram Bot using BotFather

Type /newbot

Choose a name for the bot, e.g. My Lux TWA

Choose a username for the bot, e.g. my_lux_twa_482765_bot

Take note of the access token, e.g. 5712441624:AAHmiHvwrrju1F3h29rlVOZLRLnv-B8ZZZ

Run yarn configbot then follow the dialogue to link the Telegram bot with the webapp

Points of Interest

Is this guide helpful?

Written by

On

Wed Sep 04 2024

Topics

soliditytypescriptTelegramThirdWeb