This site is not affiliated with or endorsed by Vercel, Inc. Read the docs, then deploy or run each experiment yourself.
Security

Auth-Gated Preview

Password cookie gate unlocks draft/preview content while public view stays published-only.

Run this experiment yourself

Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.

Local development

cd apps/experiments/auth-gated-preview
pnpm install
pnpm dev

Then open http://localhost:3010.

This is an experimental demo. Use it as a starting point for your own projects.

Auth-Gated Preview is a Wave 3 Batch H composition lab. Pure helpers live in logic.ts; missing providers or stores degrade honestly (never fabricate AI output).

Features

  • Password unlock sets preview cookie
  • Draft vs published content
  • Lock clears cookie

API Reference

POST /api/unlock · GET /api/content · POST /api/lock

{ "password": "preview" }
StatusCause
200Success
401Bad password

Implementation Details

Validate

Inputs are length-capped in logic.ts; APIs return 400 for missing fields.

Run

Route Handlers compose AI SDK, Redis/Neon, or ImageResponse as documented. Fallbacks include honest notes.

Limitations

  • Single shared password.
  • No user accounts.
  • Educational gate only.

Use in your project

Copy the Route Handler(s) and logic.ts from apps/experiments/auth-gated-preview/.

Deployment

Deploy on Vercel

Local Development

cd apps/experiments/auth-gated-preview
pnpm install
pnpm dev

Configuration

VariableRequiredPurpose
PREVIEW_PASSWORDNoGate password (default preview)

Next Steps

On this page