King Louie
King Louie
BABetter Auth
Created by King Louie on 3/16/2025 in #help
Conceptual questions on an auth setup with sveltekit and a separate api sever
Hey guys, I'm currently trying to build a techstack for a small SaaS around sveltekit as a frontend and graphql-yoga as a backend. Now I am stuck on how to do auth properly. Unfortunately most example repos I could find use the backend from the meta frameworks and not a separate API Server, so I couldn't find examples on how I could implement this. At the moment I planned on installing the better auth server side stuff into the yoga server and obviously put the client side better auth stuff into sveltekit. Here are my questions around this setup: -How can I access the session on the sveltekit serverside even if the better auth server stuff is installed on my separate api server? This is needed for route protection, redirects and SSR of protected routes. - Is there anything to keep in mind installing better auth on a graphql-yoga server or should this be as easy as any other node backend?
27 replies