A Next.js application that demonstrates secure authentication using Telegram Login Widget. This app allows users to quickly sign in using their Telegram account without the need for traditional username/password credentials.
- 🔐 Secure authentication using Telegram Login Widget
- ⚡ Fast and responsive Next.js application
- 🔄 Automatic session management
- 🎨 Clean and modern UI using Geist font
- 📱 Mobile-responsive design
-
First, obtain your Telegram API credentials:
- Go to my.telegram.org
- Log in with your phone number
- Click on 'API development tools'
- Create a new application if you haven't already
- You will receive your
api_id
andapi_hash
- Save these credentials securely
-
Configure environment variables:
cp .venv.example .env.local
Fill in your Telegram API credentials in the
.env.local
file:TELEGRAM_API_ID
: Your API ID from my.telegram.orgTELEGRAM_API_HASH
: Your API Hash from my.telegram.org
-
Run the development server:
npm run dev # or yarn dev # or pnpm dev # or bun dev
-
Open http://localhost:3000 with your browser to see the result.
The application implements Telegram's Login Widget to provide a seamless authentication experience. When users click the Telegram login button, they can authorize the application using their Telegram account. The app verifies the authentication data on the server side to ensure security.
- Next.js - React framework for production
- Telegram Login Widget - For authentication
- Geist Font - Modern typography
- Server-side validation and session management
To learn more about the technologies used in this project:
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.