/supabase-pack:supabase-install-authfrom supabase-pack
Installs the Supabase SDK and CLI, configures environment variables, and initializes the client for both TypeScript and Python projects.
Ships in supabase-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Install the Supabase SDK, CLI, and project credentials from scratch — covering package install, environment configuration, client initialization, and connection verification for both TypeScript (@supabase/supabase-js) and Python (supabase).
Key facts:
@supabase/supabase-jssupabase (via pip)createClient() — never new SupabaseClient()supabase start)Install the SDK and the Supabase CLI:
JavaScript / TypeScript:
# Install the SDK
npm install @supabase/supabase-js
# For SSR frameworks (Next.js, SvelteKit, Nuxt), also install:
npm install @supabase/ssr
# Install the Supabase CLI (for types, migrations, local dev)
npm install -D supabase
Python:
# Install the SDK
pip install supabase
# Install the CLI (alternative: brew install supabase/tap/supabase)
npm install -g supabase
Verify the CLI is available:
npx supabase --version
Retrieve project credentials from the Supabase Dashboard (Settings > API) and create the env file:
# .env.local (or .env)
SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIs... # anon key — safe for client-side
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1... # admin key — server-side ONLY
Add env files to .gitignore immediately:
.env
.env.local
.env.*.local
Security rules:
SUPABASE_KEY) is safe for client-side code. It respects Row Level Security (RLS) policies.SUPABASE_SERVICE_ROLE_KEY) bypasses RLS entirely. Use only on the server. Never bundle into client code or expose in browser.Create a client singleton and verify connectivity:
TypeScript — client-side (anon key):
// lib/supabase.ts
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_KEY!
)
export default supabase
TypeScript — server-side (service role key):
// lib/supabase-admin.ts
import { createClient } from '@supabase/supabase-js'
export const supabaseAdmin = createClient(
process.env.SUPABASE_URL!,
process.env.SUPABASE_SERVICE_ROLE_KEY!,
{
auth: {
autoRefreshToken: false,
persistSession: false,
},
}
)
Python — client initialization:
# lib/supabase_client.py
import os
from supabase import create_client
url = os.environ["SUPABASE_URL"]
key = os.environ["SUPABASE_KEY"]
supabase = create_client(url, key)
Verify the connection:
// Quick connectivity check
const { data, error } = await supabase.from('_health_check').select('*').limit(1)
if (error && error.code !== 'PGRST116') {
// PGRST116 = relation does not exist (expected if table doesn't exist yet)
throw new Error(`Supabase connection failed: ${error.message}`)
}
console.log('Supabase connected successfully')
Optional — generate TypeScript types from the database schema:
npx supabase login
npx supabase link --project-ref <your-project-ref>
npx supabase gen types typescript --linked > lib/database.types.ts
Then add the type parameter to the client:
import type { Database } from './database.types'
const supabase = createClient<Database>(url, key)
Completing all three steps produces:
@supabase/supabase-js or supabase Python package installednpx supabase.env.local containing SUPABASE_URL, SUPABASE_KEY, and SUPABASE_SERVICE_ROLE_KEYlib/supabase.ts or lib/supabase_client.py)lib/supabase-admin.ts, TypeScript only)| Error | Cause | Fix |
|---|---|---|
FetchError: request failed | Wrong SUPABASE_URL | Verify URL at Dashboard > Settings > API |
Invalid API key | Wrong or expired key | Copy fresh anon key from Dashboard > Settings > API |
PGRST301: JWSError | Malformed JWT in key | Remove trailing whitespace/newlines from env var |
Cannot find module '@supabase/supabase-js' | SDK not installed | Run npm install @supabase/supabase-js |
ModuleNotFoundError: No module named 'supabase' | Python SDK not installed | Run pip install supabase |
supabase: command not found | CLI not installed | Run npm install -D supabase, then use npx supabase |
Error: supabase start fails | Docker not running | Start Docker Desktop, then retry npx supabase start |
TypeError: SupabaseClient is not a constructor | Wrong import pattern | Use createClient() — not new SupabaseClient() |
Full TypeScript and Python examples with auth sign-up, sign-in, session management, SSR patterns, and type-safe queries: examples
createClient options, auth, database, storage, realtimeAfter successful setup, continue with:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
30 skills in this plugin
/supabase-advanced-troubleshootingDeep Supabase diagnostics: pg_stat_statements for slow queries, lock debugging with
pg_locks, connection leak detection, RLS policy conflicts, Edge Function cold starts,
and Realtime connection drop analysis.
Use when standard troubleshooting fails, investigating performance regressions, debugging
race conditions, or building evidence for Supabase support escalation.
Trigger: "supabase deep debug", "supabase slow query", "supabase lock contention",
"supabase connection leak", "supabase RLS conflict", "supabase cold start".
/supabase-architecture-variantsImplement Supabase across different app architectures: Next.js SSR with
server components using service_role and client components with anon key,
SPA (React/Vue), mobile (React Native), serverless (Edge Functions),
and multi-tenant with schema-per-tenant or RLS isolation.
Use when choosing how to integrate Supabase into your specific stack,
setting up SSR auth flows, configuring mobile deep links,
or designing multi-tenant data isolation.
Trigger with phrases like "supabase next.js", "supabase SSR",
"supabase react native", "supabase SPA", "supabase serverless",
"supabase multi-tenant", "supabase server component",
"supabase architecture", "supabase service_role server".
/supabase-auth-storage-realtime-coreImplement Supabase Auth (signUp, signIn, OAuth, session management), Storage
(upload, download, signed URLs, bucket policies), and Realtime (Postgres changes,
broadcast, presence). Use when building user auth flows, file upload features,
or live-updating UIs with Supabase. Trigger with phrases like "supabase auth",
"supabase storage upload", "supabase realtime subscribe", "supabase oauth",
"supabase file upload", "supabase presence", "supabase rls storage".
/supabase-ci-integrationConfigure Supabase CI/CD pipelines with GitHub Actions: link projects,
push migrations, deploy Edge Functions, generate types, and run tests
against local Supabase instances.
Use when setting up CI pipelines for Supabase, automating database
migrations, deploying Edge Functions in CI, or running integration tests.
Trigger with phrases like "supabase CI", "supabase GitHub Actions",
"supabase deploy pipeline", "CI supabase migrations", "supabase preview branches".
/supabase-common-errorsDiagnose and fix Supabase errors across PostgREST, PostgreSQL, Auth, Storage, and Realtime.
Use when encountering error codes like PGRST301, 42501, 23505, or auth failures.
Use when debugging failed queries, RLS policy violations, or HTTP 4xx/5xx responses.
Trigger with "supabase error", "fix supabase", "PGRST", "supabase 403", "RLS not working",
"supabase auth error", "unique constraint", "foreign key violation".
/supabase-cost-tuningOptimize Supabase costs through plan selection, database tuning, storage cleanup,
connection pooling, and Edge Function optimization.
Use when analyzing Supabase billing, reducing costs, right-sizing compute,
or implementing usage tracking and budget alerts.
Trigger with phrases like "supabase cost", "supabase billing",
"reduce supabase costs", "supabase pricing", "supabase expensive", "supabase budget".
npx claudepluginhub flight505/skill-forge --plugin supabase-packOther plugins' skills for the same job