Set up a Telegram Bot and Mini-app
Clone and set up the TG Mini-app starter
Mini-app development
Root
component establishes the main environment for the app by configuring Particle Auth, binding theme and viewport CSS variables, and managing application states through nested providers and hooks.
Root
component with proper viewport configuration.
Home
component manages the user interface, handling wallet connections, initializing smart accounts, and navigating through tabs.
EVMDemo
component enables users to interact with EVM-compatible blockchains via a smart account, making gasless native token transfers (Solana is also supported, just not by default within this starter).
Home
component’s tabs.Configuring Particle Auth
projectId
, clientKey
, and appId
. These values link your Telegram Mini-app with the Particle dashboard.To retrieve these values for configuration within your application, follow these steps:Access the Particle Dashboard
Create a new project or enter an existing project
Create a new Telegram application, or skip this step if you already have one
Retrieve the project ID (`projectId`), the client key (`clientKey`), and the application ID (`appId`)
projectId
, clientKey
, and appId
, add them to a .env
file located in the root of your project with the following content:Run the Mini-app
context
directory in the src
folder and add an index.tsx
file. You can find the code for this file in the starter repository.
components/Root
directory, rename your main component file to index.tsx
. Configure the AuthCoreContextProvider
to wrap the AppProvider
as follows:
Root
component in the starter repository.layout.tsx
and page.tsx
files in the src/app
directory to reflect the reference files in the starter repository.
Once configured, create a Home
component to implement your Mini-app.
SimpleAccount
.2.0.0
of SimpleAccount and targeting the Base
testnet (Sepolia) chain.Home
component and set up in the starter repository.