Detects the stack
Reads the target project's package.json and checks
for Next.js, Vite, or Express dependencies.
PlugNPlay is a small npm CLI that connects an existing project to Supabase, writes the right environment variables, and drops in framework-specific auth files without overwriting your work.
npx plugnplay-cli init
detecting package.json...
? What framework is this project using?
Next.js App Router
Vite + React
Express
? How do you want to connect?
Paste Supabase access token
Enter URL + anon key manually
created .env.local
created Supabase client files
created auth pages and helpers
next: install SDKs and test /login
The CLI is intentionally narrow. It does not create a full app, own your routing, or hide Supabase behind a new abstraction. It automates the tedious wiring you would otherwise copy from docs.
Reads the target project's package.json and checks
for Next.js, Vite, or Express dependencies.
Uses a temporary access token to list projects, or accepts a manual project URL and anon key.
Calls the Management API for the chosen project and avoids writing service role keys into generated code.
Creates env files and auth templates only when those paths do not already exist.
Shows the SDK install command and the exact page or route to wire into the app.
Each target receives files that match how that framework normally handles environment variables, sessions, and auth routes.
Session refresh, protected routes, login, signup, sign-out, and OAuth callback support.
Browser client, auth helpers, provider state, login UI, and OAuth helpers.
REST endpoints for signup, login, and logout that can be mounted in an existing server.
PlugNPlay treats credentials as setup material, not app state. It keeps the powerful token out of the generated project and writes only browser-safe Supabase configuration.
The Supabase personal access token is used for the current CLI session and is never written to disk.
Generated files use anon or publishable keys. Service role keys are deliberately avoided.
Existing files are skipped and reported instead of silently overwritten.
Project lists, API key lists, and project refs are checked before the generator trusts them.
Environment values that need escaping are quoted before they are written.
The scaffold is a starting point. Apps still need RLS policies, provider settings, and production review.
The npm package is a Node 18+ ESM CLI with a small dependency surface. This page is separate from the package and can be served by Vercel as a static root page.
npx plugnplay-cli init
inside an existing app.
plugnplay, with init,
help, and version.
vercel.json rewrites all routes to
/index.html.
/login after
installing @supabase/ssr and
@supabase/supabase-js.
AuthProvider and mount the login page in your
router.
authRouter at /auth.