Optional
apiThe API hostname for requests. Usually leave this undefined, but it can be set if using a custom domain or CNAME for the API endpoint.
Optional
callbackA callback URL for your application.
If none is provided, the auth API will redirect back to the current location (location.href
).
When handling callbacks, this URL's pathname is checked to ensure it matches the callback.
Optional
clientFactory function to create a SanityClient instance. Defaults to the standard Sanity client factory if not provided.
Optional
initialThe initial location href to use when handling auth callbacks. Defaults to the current window location if available.
Optional
providersCustom authentication providers to use instead of or in addition to the default ones. Can be an array of providers or a function that takes the default providers and returns a modified array or a Promise resolving to one.
Optional
storageStorage implementation to persist authentication state.
Defaults to localStorage
if available.
Optional
tokenA static authentication token to use instead of handling the OAuth flow. When provided, the auth store will remain in a logged-in state with this token, ignoring any storage or callback handling.
Configuration options for creating an auth store.