You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For app-wide auth, register it as a server middleware:
295
+
296
+
```ts
297
+
// server/middleware/supabase.ts
298
+
import { withSupabase } from '@supabase/server/adapters/h3'
299
+
300
+
export default withSupabase({ allow: 'user' })
301
+
```
302
+
303
+
The adapter does not handle CORS — use H3's CORS utilities for that.
304
+
255
305
## Primitives
256
306
257
307
For when you need more control than `withSupabase` provides — multiple routes with different auth, custom response headers, or building your own wrapper.
@@ -377,9 +427,10 @@ For other environments, pass overrides via the `env` config option or `resolveEn
377
427
378
428
- **Supabase Edge Functions** — environment variables are auto-injected. Zero config.
379
429
- **Deno / Bun** — works out of the box with the `export default { fetch }` pattern.
380
-
- **Node.js** — use the [Hono adapter](#hono) or [core primitives](#primitives) with your framework of choice.
430
+
- **Node.js** — use the [Hono adapter](#hono), [H3 adapter](#h3--nuxt), or [core primitives](#primitives) with your framework of choice.
381
431
- **Cloudflare Workers** — enable`nodejs_compat`in`wrangler.toml` or pass env overrides via the `env` config option.
382
-
- **Next.js / Nuxt / SvelteKit / Remix** — use core primitives to build a cookie-based auth adapter. See [`docs/ssr-frameworks.md`](docs/ssr-frameworks.md).
432
+
- **Nuxt** — use the [H3 adapter](#h3--nuxt) directly as a server middleware.
433
+
- **Next.js / SvelteKit / Remix** — use core primitives to build a cookie-based auth adapter. See [`docs/ssr-frameworks.md`](docs/ssr-frameworks.md).
383
434
384
435
## Exports
385
436
@@ -388,6 +439,7 @@ For other environments, pass overrides via the `env` config option or `resolveEn
0 commit comments