Quickstart
This procedure creates a verification session, loads the Digital ID widget, and receives the result in the sandbox.
1. Create a session
Send this request from the merchant backend. The request does not have a body:
Code
The response contains the widget URL:
Code
Keep the API key on the merchant backend. Do not put it in browser or mobile application code.
2. Load the widget
Load session_url in an iframe. Permit camera access:
Code
Register the merchant origin in the Privy allowlist.
3. Receive the result
Listen for widget events. Accept events only from the expected widget origin:
Code
Send payload.exchange_code to the merchant backend. Exchange it for a
verified-data token:
Code
The response contains a Privy-signed JWT:
Code
Verify the JWT on the merchant backend before you use its data. See Verify the JWT.
Production
Replace the sandbox API and widget hosts with the production hosts. Use the API key that Privy issued for the production environment. Complete the production readiness checklist before you go live.
