supabase-server

Implements server-side Supabase auth, client creation, and context injection for Edge Functions and Hono apps.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/akira777777/vladfsBET --skill supabase-server-akira777777
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: supabase-server
Source: https://github.com/akira777777/vladfsBET/tree/main/.grok/skills/supabase-server
Command: npx skills add https://github.com/akira777777/vladfsBET --skill supabase-server-akira777777

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @supabase/server, @supabase/ssr.

What problem does it solve? Writing server-side Supabase code traditionally requires manual client creation, auth header forwarding, CORS handling, and direct use of legacy anon/service_role keys. This Skill guides you to use the @supabase/server package correctly, eliminating boilerplate and preventing deprecated patterns. ## Core Features & Use Cases - Auth Mode Configuration: Correctly apply the four auth modes (user, publishable, secret, none), including array syntax and named keys like secret:automations. - Framework Integration: Wire up withSupabase for Supabase Edge Functions (Deno), Cloudflare Workers, and Hono apps, or compose with @supabase/ssr for Next.js and other cookie-based frameworks. - Legacy Migration: Convert Deno.serve, esm.sh imports, SUPABASE_ANON_KEY/SUPABASE_SERVICE_ROLE_KEY usage, and deprecated allow: config to modern patterns. - Use Case: When building a Stripe webhook Edge Function, the Skill directs you to use auth: 'none' with signature verification, disable verify_jwt in supabase/config.toml, and use ctx.supabaseAdmin for database writes. ## Quick Start Ask the AI to write a Supabase Edge Function that uses @supabase/server with user auth to query a database table.

Frequently Asked Questions about supabase-server

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Supabase Edge Function with authentication?▼

Use `withSupabase({ auth: 'user' }, handler)` from `npm:@supabase/server` to wrap your fetch handler. The context provides a pre-configured `ctx.supabase` client, and auth verification, CORS, and credential checks are handled automatically.

What auth modes does @supabase/server support?▼

Four modes exist: `user` for JWT auth, `publishable` for publishable keys, `secret` for secret keys, and `none` for no credentials. Array syntax like `['user', 'none']` is first-match-wins, and named keys use `secret:name` syntax.

Can I use @supabase/server with Hono or Next.js?▼

Yes, a Hono adapter exists at `@supabase/server/adapters/hono` for per-route auth middleware. For Next.js and other cookie-based frameworks, compose it with `@supabase/ssr`, which owns cookie handling and refresh-token rotation.

Why is my Edge Function request rejected before reaching my handler?▼

Supabase Edge Functions require a valid JWT by default. If your function uses `auth: 'publishable'`, `'secret'`, or `'none'`, set `verify_jwt = false` for that function in `supabase/config.toml`.

How do I migrate from SUPABASE_ANON_KEY and Deno.serve?▼

Replace manual `createClient` calls with `withSupabase` and an auth mode: `SUPABASE_ANON_KEY` with auth header becomes `auth: 'user'`, without auth becomes `auth: 'publishable'`, and `SUPABASE_SERVICE_ROLE_KEY` endpoint protection becomes `auth: 'secret'`.

When should I use auth mode none in Supabase functions?▼

Use `auth: 'none'` only for genuinely public endpoints like health checks, or for external webhooks like Stripe where you verify the provider's signature inside the handler. Never use it for endpoints reading or writing user data.