sveltekit-supabase-ssr-auth-example Svelte Themes

Sveltekit Supabase Ssr Auth Example

If you're using svelte5/sveltekit with Supabase Auth, you'll quickly find that their documentation and examples are incorrect.

sveltekit-supabase-ssr-auth-example

If you're using svelte5/sveltekit with Supabase Auth, you'll quickly find that their documentation and examples are incorrect.

Like Build a User Management App with Svelte, for example. Completely wrong if you try to follow those offical docs.

Key signs:

  • If a tutorial uses supabaseClient.js/ts, it's wrong. That the old, no-longer-supported way.
  • If a tutorial uses hooks.server.js/ts, that's correct. That one uses the new SSR Auth way.

How to use:

  • This is a barebones example code for getting login, logout, and signup to work. Copy from it, learn from it, whatever you like.
  • If you want to run it, make sure to fill out the .env with your supabase db keys. (It's on the dashboard if you look for 'Connect')

Why this

I spent an enormous amount of time trying to figure out the new Auth system because the official docs were misleading and full of gaps. Hopefully this can save someone else my pain (and maybe Supabase will update their official docs).

Good luck out there!

Top categories

Loading Svelte Themes