Overview
| Feature | UniLink (No Backend) | API Session (With Backend) |
|---|---|---|
| Setup Time | < 1 minute | 5-10 minutes |
| Backend Required | ❌ No | ✅ Yes |
Custom vendor_data | ❌ No | ✅ Yes |
Custom metadata | ❌ No | ✅ Yes |
| Per-session Callback | ❌ No | ✅ Yes |
| Session Tracking | ❌ No | ✅ Yes |
UniLink Iframe (No Backend Required)
The fastest way to get started – just copy and paste your UniLink URL.What You Need
- A Didit workflow (created in the Didit Console)
- 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_dataormetadataper 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 namedurl — use that as the iframe src.
Listening for Events (postMessage)
The verification page posts events to the parent window. Every message has this envelope:event.data.data.sessionId, not event.data.sessionId:
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.
Modal Implementation
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:| Permission | Purpose |
|---|---|
camera | Document scanning and face capture |
microphone | Video recording for liveness detection |
fullscreen | Optimal capture experience |
autoplay | Immediate camera activation |
encrypted-media | Secure media handling |
Responsive Design
Content Security Policy (CSP)
If you use CSP, add Didit to yourframe-src directive:
Cross-Device Verification
The InContext iframe automatically supports cross-device verification:- User starts verification on desktop
- If camera is unavailable, a QR code is shown
- User scans QR code on mobile
- User completes verification on mobile
- Desktop iframe automatically updates with result
Troubleshooting
Camera Not Working
- Ensure
allow="camera; microphone"is set on the iframe - Check that your site is served over HTTPS
- Verify the user has granted camera permissions to your domain
- Try the Redirect method if iframe camera access fails
Iframe Not Loading
- Check for Content Security Policy (CSP) issues
- Add
https://verify.didit.meto yourframe-srcdirective - Check browser console for errors
postMessage Not Received
- Verify you’re listening for the correct origin (
https://verify.didit.me, or your white-label domain) - Check that the event listener is added before opening the iframe
- Check the event name and shape: types are prefixed (
didit:completed, notverification_complete) and the payload is nested underevent.data.data
Example Repository
GitHub Repository
View source code and examples on GitHub