Auth object necessary in NextJS? but my backend is on another server.
I have a quick question
My API is not inside my NextJS application. It’s on a separate server in a private network, and only that server has access to the database.
My question is… how does BetterAuth verify the user’s authentication in this setup? It looks like I need to import the entire authentication object…? And then, when I call getSession, how does it verify authentication? Does it make a direct query to my database with SQL credentials? Or does it make an HTTP request to my API?
Why can’t we do auth with just the client in Next.js without importing the full auth object?? I think we need a better separation between server and client. Not everybody put their backend on vercel.
1 Reply
Okkay, nevermiind !
I lost a few hours on that, but you can use 
createAuthClient() to get that session.
it should be on the nextjs integration page documentation.
Thank you ! I still love this library !