Headless KYC
Embed multi-step KYC flow in your own interface without building custom UI against the KYC APIs.
Headless KYC is a UI module that enables partners to integrate the multi-step KYC flow directly into their applications by simply loading Transak’s KYC widget.
Current Limitations
How to integrate?
User Authentication
You can use either of the following authentication options:
Please refer to the tutorial on how to create partner access token.
Generate a quote using the Quote API
Call the Get Quote API to get a quote for the transaction. Pass the apiKey, fiat amount, fiat currency, crypto currency, network, and order type.
A successful response returns a quoteId.
Create a transaction session (using Backend only)
Call the Transaction Session API from your backend, passing the quoteId from the previous step and a new module field set to "kyc".
A successful response returns a sessionId.
Load the Headless KYC Component via Transak UI SDK
Use the Transak UI SDK to render the KYC component. Pass the sessionId received in the previous step.
The module renders no Next/Back buttons of its own, wire your own UI to the SDK’s next() / back() methods.
JS
React
React Native
Call kyc.unmount() to remove the component from the page when the user leaves the KYC screen.
onStateChange callback
The callback returns an object with these fields:
The callback fires only after onReady, and only when a value changes.
back() and next() methods
These methods are mandatory and help the user navigate between KYC forms. Add your own Back and Next buttons, and call these methods when the user clicks them.
Both methods do nothing before mount() or after unmount().
onSubmitted callback
Completion is signalled only by onSubmitted({ kycStatus }). There is no completion state in onStateChange.
kycStatusis alwaysSUBMITTED, which means the KYC is under review. The final approval comes from the KYC Webhooks.- If the user has already completed every step,
onSubmittedfires immediately on load.
onDismiss callback
The onDismiss callback has no parameters. When it fires, close the KYC module and take the user back to your app.
onError callback
The onError callback returns { code, message? }. Use the code to handle each failure case, and treat any unknown code as a generic error.
Handle the ID proof and selfie step
The ID proof and selfie step is handled inside the module via Onfido, no separate integration is required. Keep the following in mind:
- Your app is responsible for granting camera permission (native app manifest or browser).
- If permission isn’t available, the module automatically shows a fallback.
- If the user denies camera access,
onErrorreturnsCAMERA_PERMISSION_DENIED. - This step has its own in-frame buttons, so
onStateChangereturnsctaText: null. Hide your Next button on this step.
Track the final KYC status
The module’s onSubmitted callback fires once all required forms are submitted with kycStatus: SUBMITTED, it does not guarantee final approval. Use the Get KYC Requirement API to poll for the final status.
Partner can also use the KYC Webhooks to receive a notification when the final status is available.