gated, Fanfare is telling your application that the consumer must complete a public requirement before the journey can continue.
reroute() to ask Fanfare for the next public state.

Gate types
Do not explain private enforcement details in your UI. Use clear outcome language such as “Additional verification is required” or “Enter your access code to continue.”
Email or phone auth
authentication gate without OTP by exchanging a code your backend requests on the user’s behalf — see External Authentication and External sign-in below. Every session is bound to the browser’s device key; see Device-bound sessions.
Access codes
view$ value drive the message.
External sign-in
If your organization has its own sign-in, three parties take part: the shopper’s browser, your backend, and Fanfare. Your backend vouches for the shopper and obtains a one-time exchange code, and the browser redeems it for a session. The code is bound to the shopper’s device key, so only the browser that started the sign-in can redeem it. Anyone who intercepts the code cannot use it, because they cannot sign with the shopper’s key.- Read the thumbprint. Before navigating to sign-in, the page reads the thumbprint (
jkt) of the browser’s device key. - Relay it to your backend. The page sends the
jktto your own login route. Keep it on your backend, for example in the short-lived httpOnly cookie that already carries yourstateand PKCE verifier, and clear the cookie after the callback. Send it only to your own backend, never in a URL that reaches the identity provider. - Authorize with the
jkt. After your backend verifies the shopper’s identity, it callsPOST /auth/external/authorizewith your secret key and thejkt. Fanfare returns an exchange code that is valid for 60 seconds. - Exchange in the browser. The browser calls
sdk.auth.exchangeExternal({ exchangeCode }). The SDK signs the request with the same device key, and Fanfare issues a session bound to that key.
@fanfare-io/fanfare-sdk-core and, for Shopify, @fanfare-io/fanfare-sdk-shopify at version 0.28.0 or later.
Read the thumbprint in the browser
getDeviceKeyThumbprint() needs no SDK instance or provider, so it works from a sign-in link rendered anywhere on the page. It returns the SHA-256 JWK thumbprint of the key the SDK signs with, as 43 base64url characters, and creates the key on first use. Call it in the browser, from an event handler or an effect, never during server rendering.
The function is exported from the @fanfare-io/fanfare-sdk-core/admission-proof subpath. The React and Solid packages do not re-export it, so add @fanfare-io/fanfare-sdk-core as a direct dependency of your app.
When the browser has no device key that outlives the page, the call throws a FanfareError with the code ADMISSION_PROOF_UNAVAILABLE. details.reason says why:
When the call throws, do not start the external sign-in. Offer email or phone sign-in instead.
Authorize from your backend
jkt is a required field of POST /auth/external/authorize. Add it to the request body described in External Authentication:
jkt, or one that is not exactly 43 base64url characters, gets a 400 validation error and no exchange code.
The Shopify helpers take it as a required jkt option:
verifyAndAuthorizeShopifySession takes the same option. A missing or malformed jkt throws ShopifyAuthConfigurationError before any request is sent. That is a defect in your own server’s configuration, not a failed sign-in by the shopper, so surface it to your error reporting rather than to the shopper.
Exchange the code
jkt given at authorize.
Limits
- The key belongs to one origin.
www.example.comandexample.comhave different keys. A sign-in that starts on one and finishes on the other is refused at the exchange, so read the thumbprint and callexchangeExternalon the same origin. - Storage-blocked browsers cannot use external sign-in. The in-memory key such a browser falls back to does not survive the redirect, so
getDeviceKeyThumbprint()throwstab_local_key. Guest sessions and email or phone sign-in still work in that browser.
Device-bound sessions
Every consumer session is bound to a key pair that the SDK generates in the browser. The private key is non-extractable and stays on the device. The SDK signs requests with it, sending a DPoP proof in theDPoP header. A session token copied off the device does not work elsewhere, because a request that carries it must be signed by the key the session was created with.
With the SDK there is nothing to configure. The SDK signs:
- every request that carries a session token;
- session creation: guest sessions, OTP verification and the external sign-in exchange;
- session refresh.
Device-bound sessions need
@fanfare-io/fanfare-sdk-core, @fanfare-io/fanfare-sdk-react, @fanfare-io/fanfare-sdk-solid and @fanfare-io/fanfare-sdk-shopify at version 0.28.0 or later. Older versions send unsigned requests. They cannot create a session, and Fanfare refuses their requests that carry one. Upgrade the packages together.Error codes
Two 401 codes belong to device binding. Custom error handlers that switch on error codes should treat both as authentication failures.
A refresh signed by a key other than the one its refresh token was issued to returns 401
INVALID_REFRESH_TOKEN, and the SDK starts a clean re-authentication.
Keys and tabs
- One key per origin. The SDK keeps the key in the browser’s IndexedDB and serializes its creation across tabs, so every tab of an origin signs with the same key. A second tab receives the session from the first and keeps working.
- Storage-blocked browsers. When IndexedDB cannot hold the key, the SDK keeps a non-extractable key in memory instead. The session lasts until the tab closes, and a reload starts a new guest session. Two such tabs are two separate guests.
- No WebCrypto. A device without
crypto.subtle, such as a page served over plain HTTP, cannot sign. The SDK throwsADMISSION_PROOF_UNAVAILABLE, sends nothing and gets no session, guest or authenticated. Widgets show no Retry, because it cannot succeed. Serve pages over HTTPS.
Native apps
The iOS and Android SDKs carry the signing changes in source, but they have no release pipeline yet and are unsupported until one exists.Rate limits and overload
Session creation, OTP verification, experience routing andGET /consumers/me are rate limited per client. These responses are not specific to device binding, but custom clients see them:
A client that sends sustained, very high request volumes from one IP address can also be blocked before its requests reach Fanfare. That response carries no CORS headers, so a browser reports a network error instead of a status code, and the SDK does not retry mutations that fail this way.
Additional verification
For additional verification, render the verification experience your Fanfare contact has enabled for your account. When the user completes it, verify the challenge result and reroute.Verification mode
Each organization has a verification mode,botMitigation.mode:
A pass is tied to the device key that earned it. A second tab in the same browser finds the pass, and a different browser does not.
off applies to the whole organization, web consumers included. A client cannot claim an exemption for itself.
Native apps cannot present the verification yet, so a native consumer stalls at the bot_check gate. An organization that serves native apps needs mode: "off" until native apps can present it.
A mode change applies from the next routing call. Consumers already cleared keep access until it expires, up to 15 minutes.
Change the mode
Verification mode is part of the organization’s settings. An authenticated organization administrator changes it withPUT /settings on the Admin API (https://admin.fanfare.io/api), or your Fanfare contact can change it for you. The request replaces the whole botMitigation object, so send every field:
enabled is true. To restore protection, send the same request with "mode": "required". A stored setting without a mode resolves to required.
When verification is unavailable
If Fanfare cannot verify a token because the verification service is unreachable, slow or answering with errors,sdk.challenges.verify fails with 503 SERVICE_UNAVAILABLE and a Retry-After: 5 header. The check fails closed: the consumer is not let through. The failure does not use up one of the consumer’s attempts, so the same token can be submitted again after the delay. If an outage lasts, setting mode to off is the operator’s lever.
Frame and widget behavior
- Use the
iframeUrlexactly as the gate returns it. The frame posts its result only to the origin of the page that requested the challenge, and it ignores anyparentOriginquery parameter you add. A frame for an expired or unknown challenge, or one that was created without anOriginheader (a native WebView), renders a page that posts nothing. - Second tab. If another tab already solved the check, the React and Solid experience widgets reroute once instead of showing an error panel. Version
0.28.0or later is required. - Retry after expiry. When a challenge has expired, the Retry button in the React and Solid widgets fetches a fresh challenge. Older versions keep showing “Verification unavailable” until the shopper refreshes the page, so use version
0.28.0or later. - Check again after entry. A passed check lasts about an hour. If a consumer who has already entered (queued, in a draw, bidding or waitlisted) needs a fresh check to keep their access current, the React and Solid widgets show it over the current view, and the consumer keeps their place. While the consumer is in checkout, it appears only if an action that needs it is refused, which happens only on access-code or audience sequences. Headless integrations read
view.recheck: render itschallenge, verify the token withsdk.challenges.verify, then callview.recheck.complete(). Version0.28.0or later is required.