Skip to content

Kadxy/otp-share

Repository files navigation

OTP Share

OTP Share Logo

Client-Side Generation · Zero Secret Exposure · Ephemeral Sharing

Generate 2FA tokens in your browser and share them via secure, one-time links without ever revealing your secret key to the server.

Report Bug · Request Feature

Deploy with Vercel

✨ Features

  • 🔒 Zero Secret Exposure: Your TOTP secret key is used to calculate codes locally in your browser. The secret key is never sent to the server.
  • ⏱️ Ephemeral Access: Links can be set to expire after a specific time (1h, 12h, 24h).
  • 🔥 Burn After Reading: Optional "Single View" mode ensures the link is destroyed immediately after being accessed once.
  • 📱 Responsive Design: Optimized for mobile and desktop, perfect for sharing 2FA access with colleagues or family members.
  • 🛡️ Privacy Focused: No user accounts required. No tracking.

🛠️ Tech Stack

  • Framework: Next.js 15 (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Database: PostgreSQL (via Prisma ORM & Prisma Accelerate)
  • Icons: Lucide React
  • Deployment: Vercel

📸 Screenshots

Screenshot 1 Screenshot 2
Screenshot 3 Screenshot 4

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • pnpm (recommended) or npm
  • A PostgreSQL database (e.g., Vercel Postgres, Neon, or local)

Installation

  1. Clone the repository

    git clone https://github.com/Kadxy/OTP-share.git
    cd OTP-share
  2. Install dependencies

    pnpm install
  3. Configure Environment Variables Rename .env.example to .env and add your database connection string. Since this project uses Prisma Accelerate, you need an Accelerate URL (You can get it from Vercel).

    PRISMA_DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/..."
  4. Generate Prisma Client & Push Schema to Accelerate

    npx prisma generate && npx prisma push
  5. Run Development Server

    pnpm dev

    Open http://localhost:3000 with your browser.

📖 How It Works

  1. Input Secret: User enters their TOTP Secret Key in the browser.
  2. Local Calculation: The browser calculates all future TOTP codes for the selected validity period (e.g., next 1 hour).
  3. Secure Storage: Only the generated codes (not the secret key) are sent to the server and stored in the database.
  4. Link Generation: A unique, random 7-character ID is generated.
  5. Access: The recipient opens the link and sees the valid code for the current time window.

🤝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.

About

Generate 2FA tokens in your browser and share them via secure, one-time links without ever revealing your secret key to the server.

Topics

Resources

License

Stars

Watchers

Forks

Contributors