Build with Sanity MCP in Replit. Prizes up for grabs! Submit by June 14

NextJS with Auth0: Choose Single Page App or NextJS integration?

1 replyLast updated: Dec 1, 2025

I'm also thinking of using Auth0 to authenticate the users, in Auth0, they have something for single page app (react application) and something that's for Traditional applications. My sanity.io template uses NextJS which is also a react application, do I chose the Auth0's Single Page App integration (for React) or Auth0's NextJS integration ? I'm a bit lost here
AI Update

I appreciate the question, but this is actually more of an Auth0/Next.js architecture question than a Sanity-specific one. Since you're asking specifically about which Auth0 SDK to use for your Next.js application, you'd get better guidance from the Auth0 community or Next.js forums where they can dive deep into the differences between their SPA SDK and Next.js SDK.

That said, I can briefly point you in the right direction: for Next.js applications, you should use Auth0's Next.js SDK (@auth0/nextjs-auth0) and create a "Regular Web Application" in Auth0's dashboard, not the SPA integration. This is because Next.js has server-side capabilities (API routes, server components, middleware) that the Next.js SDK is designed to leverage.

Where this connects to Sanity: Once you have Auth0 set up in your Next.js app, you might want to integrate it with Sanity in a few ways:

For the core Auth0 SDK selection question though, I'd recommend checking Auth0's official Next.js documentation or asking in their community forums for the most detailed guidance specific to their SDKs.

Show original thread
1 reply

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions