ConstAuthBoundary mounts this automatically, so most apps never need it
directly. Mount it yourself only when your app runs inside the dashboard
without AuthBoundary — that is, the app renders its own loading and error
UI instead of the SDK's login flow — but still uses SDK hooks such as
useQuery, which need the dashboard's token in the auth store to
authenticate their requests.
Mount it once, inside the provider that creates the Sanity instance whose store should receive the token.
Authenticates the SDK with the Sanity Dashboard's session when the app runs inside the dashboard.
The dashboard owns the session there: this provider subscribes to the token the dashboard issues, writes each new value into the SDK's auth store (where SDK hooks read it from), and asks the dashboard for a fresh token when a request fails with a 401. Outside the dashboard it renders children unchanged and the app's normal auth flow applies.