CLI Setup
The Supakeys CLI automates the setup of passkey authentication in your Supabase project.
Install the CLI
npm install -D supakeysOr run directly with npx:
npx supakeys initRunning the Init Command
The init command sets up everything you need:
npx supakeys initWhat It Creates
- Database Migration - SQL file in
supabase/migrations/for passkey tables - Edge Function - TypeScript function in
supabase/functions/passkey-auth/
Command Options
npx supakeys init [options]
Options:
-d, --dir <directory> Supabase directory (default: "./supabase")
--skip-migration Skip database migration setup
--skip-function Skip edge function setup
--dry-run Show what would be created without writing filesDry Run Mode
Preview what will be created without writing files:
npx supakeys init --dry-runThis shows:
- Migration SQL that would be created
- Edge function code that would be deployed
- Client code examples for your framework
Framework Detection
The CLI automatically detects your framework by looking for config files:
| Framework | Detection |
|---|---|
| Next.js | next.config.* |
| Remix | remix.config.* |
| SvelteKit | svelte.config.* |
| Nuxt | nuxt.config.* |
| Astro | astro.config.* |
| React | react in dependencies |
| Vue | vue in dependencies |
After Running Init
Once the CLI completes:
-
Link your Supabase project:
supabase link --project-ref YOUR_PROJECT_REFFind your project ref in the dashboard URL:
https://supabase.com/dashboard/project/YOUR_PROJECT_REF -
Run the migration:
supabase db push -
Deploy the edge function:
supabase functions deploy passkey-auth