← All case studies

Lead handling

Gated demo access with one-click approval

Visitors can upload their own invoices to the live demo, which costs money per run. Access is granted through an email link and a one-click approval, with hard limits on usage. No accounts or passwords.

Running in production on this site since launch.

1 click

to approve a request from my inbox

5

uploads per approved visitor

100

uploads per day, hard cap across all visitors

  1. 1

    Visitor

    Enters email on the demo page

  2. 2

    Sign-in link

    Verifies the address

  3. 3

    Approve link

    Arrives in my inbox

  4. 4

    Access

    5 uploads, under a daily cap

How the automation works, step by step

The problem

Letting anyone upload documents to an AI pipeline invites abuse and unpredictable API costs. A full sign-up system with accounts and passwords would be too much friction for a demo, and too much to maintain.

What I built

The flow has four steps, all handled by the site itself:

  • The visitor enters their email and receives a sign-in link, valid for 30 minutes.
  • Clicking it verifies the address and sends me a notification with an approve link.
  • One click on that link approves the visitor, who can then upload up to five invoices.
  • A daily cap across all visitors limits the worst case if something goes wrong.

Security details

Tokens are signed with HMAC and scoped, so a sign-in link can't be reused as a session, and the approve link can only approve. Upload counts live in SQLite and are refunded if a run fails.

Results

Every upload is tied to a verified email address, and API costs have a known ceiling. Approving someone takes one click from my inbox, and nobody has to manage passwords.

Built with

Next.js route handlers, HMAC-signed tokens, Resend, SQLite.