Iframe Integration
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.
Why Choose Iframe Integration?
✅ 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
1. Enabling Iframe Mode
To enable iframe integration mode, you must configure the iframeEnabled parameter in the generateUrl API.
2. Embedding the Iframe
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 |
<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
3. Event Handing
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.
How to Usetype andcode
type andcode-
Event Type (
type):- When
typeiscomplete, the workflow has finished, and you should check thecodefield for details.
- When
-
Event Code (
code):- Use the
codevalue to identify the specific reason for the completion and take appropriate actions.
- Use the
Updated 8 days ago
