Provide example/SDK for server side authentication with Auth0 for Sveltekit

Feature: Provide example/SDK for server side authentication with Auth0 for Sveltekit

Description: There are no official SDK for handling server side authentication similar to your Next.js lib but for Sveltekit.

Welcome to the Auth0 Community and thanks for the request @lillheaton!

Please don’t forget to click the Vote button.

3 Likes

I’m out of votes otherwise I would upvote this! @lillheaton I was able to get it working with Sveltekit by using the openid client that the Next.js SDK uses under the hood and following what they did as a template. Happy to share/jam on the approach if it would be helpful.

It would be great to have a fully certified SDK for Sveltekit though!

2 Likes

Could you elaborate a bit more on your approach? Looking to do the same.

1 Like

Sure. I can’t share my code directly here, but it’s almost identical to what Auth0 has done for Next.js: GitHub - nextauthjs/next-auth: Authentication for the Web.

I found the architecture diagram here most helpful: nextjs-auth0/ARCHITECTURE.md at main · auth0/nextjs-auth0 · GitHub

And the main entry points are login.ts, callback.ts, and logout.ts here.

2 Likes

I have written a detail article on authentication in SvelteKit with Auth0 using SvelteKitAuth (NextAuth / Auth Js)

2 Likes

I’ve done something similar @aakashgoplani but much leaner and without SvelteKitAuth.

https://wordpress.com/post/dejanvasic.wordpress.com/1031