Sanity Pioneers: Get early access to betas, extra AI credits, and a direct line to the engineering team. Apply now

How to handle JWT authentication and authorization in Sanity CMS?

13 repliesLast updated: Nov 29, 2025

Hi all, I hope you have had a great day.I'm new to sanity and I'd like to ask a question that might sound silly.
I have a react application where my users log in to access some data, is it possible to handle my form authentication & authorization (jwt) using sanity or other backend programming languages like node.js and MongoDB are required to do so?
AI Update

Not a silly question at all! This is a common point of confusion for folks new to Sanity.

The short answer: Sanity does not provide end-user authentication for your front-end application users. You'll need to use a third-party authentication service for handling JWT authentication and authorization for your React app users.

Here's what you need to understand:

Two types of "users" in Sanity:

What you should use instead:

For end-user authentication with JWT, you'll want to integrate a third-party auth service like:

How it works together:

Once you have your auth system in place, you can:

Can you technically store user data in Sanity? Yes, but it's strongly not recommended for sensitive authentication data. Sanity is built for content publishing and sharing, not as a secure authentication system. Keep your user credentials, passwords, and sensitive auth data in dedicated authentication services.

Think of it this way: Use Sanity for your content (articles, products, etc.) and a dedicated auth service for your users (login, permissions, sessions).

Show original thread
13 replies

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