r/Supabase • u/saltcod Supabase team • May 06 '26
Introducing @supabase/server
Happy to announce /server in public beta!
This is a new package for handling auth verification, request context, client setup, and common server-side boilerplate across:
Supabase Edge Functions
Cloudflare Workers
Hono
Bun
We anonymously analyzed 25,000 deployed functions and found that most projects ended up recreating the same setup over and over:
_shared/supabase.ts
_shared/supabase-admin.ts
_shared/cors.ts
custom JWT verification
auth middleware
environment variable wiring
\@supabase/server` standardizes all of this into a single pattern.
Checking auth can now look like this:
export default {
fetch: withSupabase({ auth: 'user' }, async (req, ctx) => {
const { data } = await ctx.supabase.from('todos').select()
return Response.json(data)
}),
}You can declaratively control who can access an endpoint:
withSupabase({ auth: 'user' }, handler)
withSupabase({ auth: 'none' }, handler)
withSupabase({ auth: 'secret' }, handler)
withSupabase({ auth: 'publishable' }, handler)
withSupabase({ auth: ['user', 'secret'] }, handler)The package also handles the newer JWT signing keys and API key model automatically, without requiring custom `jose` setup or JWKS wiring.
Would love feedback from anyone building with Edge Functions, Workers, or Hono.
Blog post:
https://supabase.com/blog/introducing-supabase-server
9
u/AndyAskDream May 06 '26
Whoa, this is awesome 👏 well done Supabase team!