- Gives your app a widget session when the user opens the widget.
- Receives the
user.accepted_termswebhook. - Registers the user with their KYC data.
apiKey and secretKey as described in Authentication.
1. Issue a widget session
Expose an endpoint in your backend that your app calls right before opening the widget. It returns thesharedKey and clientId from your environment variables and a new nonce.
Node.js (Express)
Python (FastAPI)
2. Receive the terms acceptance webhook
When the user accepts the Terms and Conditions inside the widget, Kravata calls your webhook with theuser.accepted_terms event. Use it as the signal to register the user (step 3).
In production, Kravata registers this webhook for you during onboarding. In test you can register it yourself with Register Webhook Endpoint. You only need to do it once per environment.
Payload
- With payloadMapping (recommended)
- Without payloadMapping
Your server receives only the fields you mapped. With the example above,
user_id is the ID you passed to the SDK as userId:Handle the event
Node.js (Express)
2xx quickly and do the registration asynchronously. Deliveries can be retried, so make the handler idempotent. See Best practices.
3. Register the user
Call User Registration with the user’s KYC data, thex-integration-register header, and the same ID you passed to the SDK as external_user_id.
The body field that carries your user ID depends on the field mapping of your integration:
external_user_id by default. If Kravata configured your integration with another name, such as user_id, send it under that name. Either way, Kravata stores it as EXTERNAL_USER_ID.user_id in the response is Kravata’s internal ID for the user, not yours. Store it next to your own ID: the Stack API uses it in every user endpoint (accounts, wallets, operations).
See Users for the full field list, statuses and the KYC review.
4. Follow the user’s status
After registration the user is reviewed automatically. Subscribe touser.updated to know the result:
The complete list of statuses is in Users.

