Skip to main content
Embed the Didit verification flow directly within your application using an iframe. This provides a seamless experience without redirecting users away from your site.

Overview


The fastest way to get started – just copy and paste your UniLink URL.

What You Need

  1. A Didit workflow (created in the Didit Console)
  2. Your UniLink URL (click Copy Link on your workflow)

Implementation

⚠️ Required: The allow attribute is mandatory for camera access during liveness detection.

Key Benefits

  • Less than 1 minute setup — No backend, no API keys
  • Zero configuration — Callback URL set in workflow settings
  • Ideal for MVPs — Get started immediately

API Session Iframe (With Backend)

For advanced integrations that need per-session customization.

When to Use

  • Pass custom vendor_data or metadata per session
  • Set different callback URLs per session
  • Track sessions server-side before verification starts
  • Associate sessions with your user IDs

Implementation

Step 1: Create a session (backend) The session-create response uses a field named url — use that as the iframe src.
Step 2: Embed in iframe (frontend)

Listening for Events (postMessage)

The verification page posts events to the parent window. Every message has this envelope:
The payload is nested — read event.data.data.sessionId, not event.data.sessionId:
Key events: didit:ready ({ sessionId }), didit:started, didit:step_started / didit:step_completed / didit:step_changed ({ step, ... }), didit:status_updated ({ status }), didit:completed ({ sessionId, status }), didit:cancelled, didit:error ({ error, step? }), and didit:close_request. See the full table in the JavaScript SDK event reference — the JavaScript SDK wraps this same contract in typed callbacks if you’d rather not handle raw messages.
For a polished modal experience that overlays your page:

HTML/CSS/JS


React Component

A reusable React component for modal-based verification:

Usage


Vue Component


Configuration

Required Permissions

Always include these permissions for camera and media access:

Responsive Design

Content Security Policy (CSP)

If you use CSP, add Didit to your frame-src directive:

Cross-Device Verification

The InContext iframe automatically supports cross-device verification:
  1. User starts verification on desktop
  2. If camera is unavailable, a QR code is shown
  3. User scans QR code on mobile
  4. User completes verification on mobile
  5. Desktop iframe automatically updates with result
This happens automatically – no additional configuration needed.

Troubleshooting

Camera Not Working

  1. Ensure allow="camera; microphone" is set on the iframe
  2. Check that your site is served over HTTPS
  3. Verify the user has granted camera permissions to your domain
  4. Try the Redirect method if iframe camera access fails

Iframe Not Loading

  1. Check for Content Security Policy (CSP) issues
  2. Add https://verify.didit.me to your frame-src directive
  3. Check browser console for errors

postMessage Not Received

  1. Verify you’re listening for the correct origin (https://verify.didit.me, or your white-label domain)
  2. Check that the event listener is added before opening the iframe
  3. Check the event name and shape: types are prefixed (didit:completed, not verification_complete) and the payload is nested under event.data.data

Example Repository

GitHub Repository

View source code and examples on GitHub