This section provides a comprehensive guide to integrating the AAI iframe into your application. It includes steps for embedding the iframe, handling events, and interpreting the event codes.
✅ Better User Experience: Users stay on your domain throughout the process ✅ Full Control: Maintain your app's context and navigation ✅ Seamless Integration: No page redirects or new windows ✅ Real-time Events: Receive instant updates via postMessage API ✅ Better Branding: Keep your app's look and feel
To enable iframe integration mode, you must configure the iframeEnabled parameter in the generateUrl API.
To integrate the iframe, include it in your HTML using the following structure:
| Attribute Value | Purpose | Required |
|---|---|---|
autoplay | Allow autoplay of video streams | true |
camera | Allows invocation of camera permissions | true |
clipboard-write | Allow links to be copied during the fallback process | false |
xxxxxxxxxx <iframe src="kyc-generated-url-here" allow="autoplay;camera;clipboard-write;"></iframe>Note: If the clipboard-write permission is not granted, the copy operation may fail. In such cases, a postMessage event with type 'copy' will be dispatched. For details, please refer
The iframe emits events to notify the parent application about workflow progress and completion. When the type is complete, the code field provides additional details about the outcome.
type andcodeEvent Type (type):
When type is complete, the workflow has finished, and you should check the code field for details.
Event Code (code):
Use the code value to identify the specific reason for the completion and take appropriate actions.