Add Didit KYC to a Lovable App: Identity Verification Guide
We don’t document a native Lovable connector. Embed the documented iframe UniLink or call the session API from your own endpoint. $0.33 per full KYC check, sandbox free.

Contents
In this guide
Jump to the part you need.
If you’re adding KYC to signup, onboarding or payouts in a Lovable app, use our hosted iframe for document and selfie capture. For account-level decisions, create sessions on your server and verify signed webhooks. We charge $0.33 per completed full KYC check, and sandbox testing is free. We don’t document a native Lovable connector.
Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.
| Item | What you get |
|---|---|
| Didit product | User Verification (KYC), Business Verification (KYB), Transaction Monitoring |
| Lovable connector | We don’t document a native Lovable connector. Use the InContext iframe (UniLink) or the REST API plus webhooks. |
| Fastest path | Iframe with a UniLink, no backend, no API key in the browser |
| Full control path | POST https://verification.didit.me/v3/session/, then a webhook or GET /v3/session/{session_id}/decision/ |
| Price per full KYC check | $0.33 (ID $0.15 + passive liveness $0.10 + face match $0.05 + device and IP $0.03) |
| Free plan | The Free plan includes $10 in monthly credit for the first organization created with an eligible company-domain work email. Unused credit expires each month, and phone verification codes are excluded. Sandbox testing is free and unlimited on every plan. |
| Who this fits | Lovable builders shipping a signup, onboarding or payout flow that needs document, face and watchlist checks |
Does Lovable have a native Didit connector?
We don’t document a native Lovable connector. To add Didit to your app, use our documented InContext iframe with a UniLink, or create sessions on your server and receive signed webhooks.
Choose the integration based on whether your app needs to match each verification to a signed-in user.
- InContext iframe with a UniLink. One
<iframe>tag, no backend, no API key anywhere near the browser. Use it to get a flow live and to see what your users actually see. - REST API plus webhooks. Your server creates the session with
POST /v3/session/, sends your own user id asvendor_data, and receives the decision on a webhook. Use it when a verification has to be tied to an account, a plan or a payout.
Our MCP server is a third option when a coding assistant is writing the code for you. It is a tool for the assistant, not a runtime dependency of your Lovable app. Setup is documented in Didit MCP setup. For the canonical end-to-end prompt, use the Didit integration prompt.

Prerequisites
| Requirement | Details | Where it comes from |
|---|---|---|
| Didit plan | Free plan is enough to start. The $10 monthly credit applies if eligible: first organization created with an eligible company-domain work email. Unused credit expires monthly and phone verification codes are excluded. Paid plans are Growth $99 a month, Scale $299 a month, Enterprise from $15,000 a year. Sandbox is unlimited and free. | didit.me/pricing |
| Didit API key (API route only) | For the API route only. Programmatic registration returns sandbox_application.api_key and application.api_key separately. The iframe UniLink route needs no API key in the browser. | Quick start |
| Published workflow | A KYC or KYB workflow, published. The iframe uses the workflow’s shareable UniLink; API session creation uses its UUID. | Business Console, Workflows |
| Lovable project | An app you can edit through the chat and, when needed, through code view. | Lovable |
| Server endpoint | Only if you take the API route. The key never ships in client code, so the session call lives on a server function or your own backend. | Your stack |
| Permissions | The iframe needs the documented allow attribute for camera, microphone and geolocation, and the page must be served over HTTPS. | Web SDKs |
Add KYC in Lovable in 6 steps
Step 1: Create the workflow in the Didit Business Console
Go to business.didit.me, sign up, and create your Organization. Then open Workflows in the sidebar and click New workflow. Choose Verifying users for KYC, then pick Start from a template and take the KYC template, or Start empty if you already know the exact checks. A Simple workflow runs its steps in a fixed order; a Node-based workflow branches on results. Publish it. If you take the API route, copy the workflow UUID and your API key.
Step 2: Build the iframe URL (no backend needed)
The InContext iframe accepts a UniLink built from your workflow id, base64 encoded, as the path segment. It needs no backend and no key. This is the fastest way to see Lovable identity verification running in your app.
<iframe
src="https://verify.didit.me/u/YOUR_WORKFLOW_ID_BASE64"
allow="camera; microphone; geolocation; clipboard-write; fullscreen; autoplay; encrypted-media; digital-credentials-get"
></iframe>
Keep the allow attribute exactly as written. If selfie capture fails, check the iframe’s camera permission and test on the published HTTPS URL.

Step 3: Paste a build prompt into Lovable
Give Lovable the constraint that matters most: no key in the browser. Paste this into the chat for the iframe route.
Add identity verification with Didit to this app.
1. Add a "Verify identity" button on the account page.
2. On click, open this URL in a full-height iframe:
https://verify.didit.me/u/PASTE_YOUR_BASE64_WORKFLOW_ID
3. Give the iframe this allow attribute, exactly:
camera; microphone; geolocation; clipboard-write; fullscreen; autoplay; encrypted-media; digital-credentials-get
4. Do not add an API key, webhook handler or account-status update for this iframe-only version.
5. Review outcomes in the Didit Business Console.
Review the generated component before you publish. The two things to check are the allow attribute and the absence of any key in the client bundle. If verification has to gate access for a signed-in user, use the API route below instead.
The second prompt is for the API route, where each verification must match an authenticated user.
Add Didit verification with server-created sessions to this app.
1. Create a server function that calls POST https://verification.didit.me/v3/session/ with x-api-key from server secrets, workflow_id YOUR_PUBLISHED_WORKFLOW_UUID, vendor_data set to the authenticated user id, and callback https://your-app.example.com/kyc/return. Return only session_id and url to the client.
2. Add a "Verify identity" button that requests that server function and opens the returned url in the iframe or with DiditSdk.shared.startVerification({ url }).
3. Add a webhook endpoint at /api/webhooks/didit. Retain the raw body, reject a missing or invalid X-Timestamp or one more than 300 seconds from server time in either direction, compute HMAC-SHA256 over the sorted, Unicode-preserving canonical JSON, and compare it with X-Signature-V2 in constant time before processing the event.
4. De-duplicate by event_id and return 2xx within five seconds. Grant access only for Approved on the user’s matching session in the expected environment.
5. Never put a Didit API key in client code.
Step 4: Move session creation to a server endpoint
As soon as a verification has to be tied to your own user, create the session yourself with the Create Session API. The workflow’s type decides what kind of session is created, so there is no separate KYB endpoint. Replace YOUR_PUBLISHED_WORKFLOW_UUID with the actual UUID of the published workflow before running the command.
curl -X POST https://verification.didit.me/v3/session/ -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{"workflow_id": "YOUR_PUBLISHED_WORKFLOW_UUID", "vendor_data": "user-42", "callback": "https://your-app.example.com/kyc/return"}'
The response carries session_id, url and session_token. Send the url to your component and open it in the iframe, the JavaScript SDK with DiditSdk.shared.startVerification({ url }), or a redirect. vendor_data binds the session to your user identifier and helps detect duplicates across sessions.
The callback appends ?verificationSessionId={session_id}&status={status}. Use those parameters for navigation and display only. Change account access only after a signed webhook or a decision call returns the matching session. The fallback GET /v3/session/{session_id}/decision/ call requires a key with read:sessions.
Step 5: Register the webhook and store the decision
The iframe shows the user an outcome, but the authoritative decision arrives on a webhook. Register a destination once per environment.
curl -X POST https://verification.didit.me/v3/webhook/destinations/ -H "x-api-key: $DIDIT_API_KEY" -H "Content-Type: application/json" -d '{"label": "Lovable production", "url": "https://your-app.example.com/api/webhooks/didit", "subscribed_events": ["status.updated", "data.updated"], "webhook_version": "v3"}'
Save the returned secret_shared_key as DIDIT_WEBHOOK_SECRET. On every delivery, retain the raw body, reject a missing or invalid X-Timestamp or one more than 300 seconds from server time in either direction, compute HMAC-SHA256 over the sorted, Unicode-preserving canonical JSON, and compare it with X-Signature-V2 in constant time before processing the event. De-duplicate on event_id and answer 2xx within five seconds. If your handler is slow or returns 5xx, Didit retries twice (about one and four minutes later) and then drops the delivery; you can resend it from the destination’s delivery log.
Step 6: Switch from sandbox to live
For the API route, configure the live key and live workflow UUID on your server, register the live webhook destination, and save its signing secret. Confirm the organization has credit and that the live callback origin is allowed if you use a callback. The frontend can keep opening the session URL returned by your server.
Status mapping for access
| Status | What your app does |
|---|---|
Approved | Grant access only when the signed webhook or decision call says Approved for the user’s matching session in the expected environment. |
In Review | Keep access pending. A reviewer decides in the Business Console. |
Declined | Do not grant access. Notify the user and optionally request a resubmission. |
Resubmitted | Keep access pending until the user completes the new steps and a later Approved arrives. |
Kyc Expired | Remove or restrict access until a new verification is Approved. |
Field and event mapping
| Didit field | Where it comes from | What your app does with it |
|---|---|---|
session_id | Create session response, webhook envelope | Store on the user record. Use it to match webhook events and decision responses to the session your app created. |
vendor_data | You send it on create | Your own user id. Binds the session to the account. |
status | Top level of the retrieve-session response and webhook envelope. | Gates access. Exact, case-sensitive strings. |
session_kind | Decision object | Branch: user for KYC, business for KYB. |
id_verifications[] | Decision object | Document verification results, including extracted data and any barcodes. |
liveness_checks[] | Decision object | Liveness verdict for the biometric step. |
face_matches[] | Decision object | Selfie to document match result. |
aml_screenings[] | Decision object | AML screening results for review, including sanctions and PEP matches. |
decision_trace | Decision object | Shows how the decision was made. The documented decided_by values are manual, automatic and investigator. |
event_id | Webhook envelope | De-duplicate deliveries before you write to the database. |
X-Signature-V2 | Webhook header | Verify HMAC-SHA256 over the sorted, Unicode-preserving canonical JSON before processing the event. |
X-Timestamp | Webhook header | Reject if missing or invalid, or more than 300 seconds from server time in either direction. |
| Event | Fires when | Subscribe if |
|---|---|---|
status.updated | A session or business session status changed | Always. Grant access only for Approved on the user’s matching session in the expected environment. |
data.updated | Verification data on a session was edited | You display decision data in the app. |
user.status.updated | A User entity moved to ACTIVE, FLAGGED or BLOCKED | You reuse Didit user entities across sessions. |
business.status.updated | A Business entity status changed | You run KYB onboarding. |
Test with sandbox data before you go live
The sandbox is free and unlimited on every plan. It reproduces outcomes deterministically with no real personal data and no billing. Concretely:
- Read the scenario catalog at
GET /v1/sandbox/scenarios/, then pass the slug assandbox_scenarioon create and the bundled magic values are applied tocontact_detailsandexpected_details. - Re-arm a session that has not started yet with
POST /v3/session/{session_id}/sandbox/arm/. sandbox_scenariois rejected with 400 on live applications.
Expected success. For a sandbox workflow that runs ID verification, passive liveness and face match, a clean scenario ends with status Approved, the webhook arrives with environment: "sandbox" and a full decision object, and the plural arrays are populated. Fields for checks that did not run may be absent or null. Grant access only for Approved on the user’s matching session in the expected environment.

| Case | What to do | What you should see |
|---|---|---|
| Approval | Run a clean approval scenario. | The webhook says Approved. The app grants access only for the matching user and session in the sandbox environment. |
| Decline or review | Run a decline or review scenario. | The status is Declined or In Review. The app keeps access pending or denied; a reviewer decides the outcome of a session with status In Review. |
| Duplicate webhook | Send or resend the same event_id. | The app applies one idempotent update and does not grant access twice. |
| Symptom | Cause | Fix |
|---|---|---|
| 403 with "You do not have permission to perform this action." | Missing API key on the verification API | Send the x-api-key header. |
| 401 | Wrong, revoked or expired key | Issue a new key and update the server function secret. |
| 400 on create | Invalid workflow_id | Copy the UUID from the published workflow, not the workflow label. |
| 400 with "callback must be on one of the application’s allowed domains" | Callback origin not allowlisted | Use a callback URL whose scheme, host and port match an allowed origin. If you omit callback, confirm that the workflow default is on an allowed origin before relying on the redirect. |
400 on session_expiration_time | Value outside 3600 to 2419200 seconds | Use a whole number inside the range or omit the field. |
| Iframe renders but the selfie step shows nothing | Missing camera permission | Restore the full allow attribute and serve the page over HTTPS. |
| 404 on the decision call | Session id from another application, or a typo | Use the session_id returned by create. |
| Webhook delivery fails or retries | Handler slower than 5 seconds, or it answered 5xx or 404 | Verify the signature, deduplicate by event_id, apply the update idempotently, and return 2xx within five seconds. Resend failed deliveries from the destination’s delivery log after fixing the handler. |
| Status check never matches | Comparing lowercased statuses | Match exact strings, including In Review and Kyc Expired with a single capital K. |
What Didit verification costs in a Lovable app
The examples below use Didit’s published USD list prices. Full KYC and AML screening are billed per completed check from prepaid credit.
- Full KYC check: $0.33
- AML screening: $0.20 per check
- Ongoing AML monitoring: $0.07 per person a year
- Business verification: registry retrieval starts at $2.00 per company. Company AML at $0.20 per check, person AML at $0.20 per UBO or officer, and linked KYC at $0.33 per person are separate charges when those checks run.
- Phone verification: the carrier price for the country and channel plus Didit’s $0.02 fee per code
- Wallet screening: $0.15 per screening, or bring your own screening provider and run it inside Didit
Worked example. A Lovable app does 1,000 completed KYC checks and 1,000 AML screens in a month.
- If eligible for Free plan credit: 1,000 x $0.33 = $330.00, plus 1,000 x $0.20 = $200.00, so $330.00 + $200.00 = $530.00. Then $530.00 − $10.00 = $520.00 with eligible monthly credit.
- On Scale at $299 a month: the 10% plan discount gives $0.33 x 0.90 = $0.297 per KYC, so 1,000 x $0.297 = $297.00, and $0.20 x 0.90 = $0.18 per AML screen, so $180.00. Total usage $477.00. The $350.00 monthly credit covers the first $350.00, leaving a $127.00 top-up. Spend is $299.00 + ($477.00 − $350.00) = $426.00.
- $426.00 is the total monthly spend on Scale, including the $299.00 plan fee and the $127.00 top-up. That is $94.00 less than the $520.00 the same usage costs on the Free plan with eligible monthly credit, and $104.00 less than the $530.00 it costs on the Free plan with no credit.
4,000+ companies run Didit today, and the sandbox stays free on every plan.
Disconnecting Didit from your Lovable app
- Remove the verification component and the iframe from the Lovable project, then publish.
- Delete the server function or endpoint that called
POST /v3/session/, and remove the stored key from its secrets. - Before retiring the endpoint, remove it from your Didit webhook configuration. Revoke any Didit API key dedicated to this integration.
- Keep or delete the stored decisions according to your own retention policy and your regulator’s rules.
Sources
- Didit Quick Start
- Didit Web SDKs: JS and iframe
- Didit Create Session API
- Didit Retrieve Session API
- Didit Webhooks and HMAC signing
- Didit Verification Statuses
- Didit Sandbox Test Data
- Didit Pricing in the docs
- Didit pricing page
- Didit pricing JSON feed
- Didit MCP server
- Didit integration prompt
Create a free Didit organization and use your sandbox API key to create a KYC session. Open the returned verification URL and test the decision before switching to live credentials. No sales call is required.
Try it
Try this in the sandbox
Run the check this guide describes, free.
The product this post is about, taken from its topic. Run it free in the sandbox.
Author
Alberto Rosas
Co-founder and CEO

Questions
Frequently asked questions
Can I add KYC in Lovable without a backend?
Yes, for the capture step. The InContext iframe with a UniLink needs no backend and puts no API key in the browser, which is why it is the right first build. In an iframe-only build you review outcomes in the Didit Business Console. To update an account automatically, add server-created sessions and signed webhooks.
Does Lovable have a Didit integration or connector?
We don’t document a native Lovable connector. To add Didit to your app, use our documented InContext iframe with a UniLink, or create sessions on your server and receive signed webhooks.
Where do I keep the Didit API key in a Lovable project?
Server side, always. Anyone who can load the app or preview can inspect the client code. Keep the Didit API key in server-side secrets. Put the POST /v3/session/ call in a server function or your own endpoint and pass only the returned session URL to the client.
How much does identity verification cost inside a Lovable app?
A full KYC check is $0.33, made of ID document $0.15, passive liveness $0.10, face match $0.05 and device and IP $0.03. Adding AML screening takes it to $0.53. The Free plan gives $10 of monthly credit if eligible for the first organization created with an eligible company-domain work email, and the sandbox never bills.
How do I get the verification result back into my Lovable app?
Register a webhook destination, verify X-Signature-V2, and update the user record when status.updated arrives. The signed event carries the status and includes the decision object only for Approved, Declined, In Review and Abandoned. When the app needs the full decision and the event omits it, call GET /v3/session/{session_id}/decision/, which needs a key with read:sessions.
Can I test the flow without real documents or paying anything?
Yes. Sandbox testing is free and unlimited on every plan. Use the sandbox API key, pass a scenario slug from GET /v1/sandbox/scenarios/ as sandbox_scenario on create, and you get a deterministic Approved, Declined or In Review outcome with no personal data.
What happens in my app if a user fails verification?
You get Declined with warnings explaining the failure, or In Review when automated checks flagged something a person must look at. Handle the strings exactly as returned, including the space and the capital letters, and let a reviewer move an In Review session to Approved, Declined or Resubmitted.
Does the Didit iframe work in Lovable’s preview?
The iframe needs the documented allow attribute and a page served over HTTPS for the camera to open. Browsers can block camera access when a page is embedded inside another frame, so confirm on your published app URL before you debug the code.
Can I verify businesses as well as people in a Lovable app?
Yes. Create a KYB workflow and call the same POST /v3/session/ endpoint; the workflow type decides the session kind. Branch on session_kind in the decision, and budget from $2.00 per company for registry retrieval, plus company AML at $0.20, person AML at $0.20 per UBO or officer and linked KYC at $0.33 per person when those checks run. See the retrieve session docs for the KYB arrays.
Can a coding assistant help me add Didit to Lovable?
Yes. Give the assistant the Didit integration prompt linked in this guide and the documented Didit MCP setup, then review the code it writes. MCP is a build-time tool for the assistant, not a runtime dependency of the app.
How do I remove Didit from a Lovable app later?
Remove the component and server function, remove the endpoint from your Didit webhook configuration, and revoke the API key dedicated to this integration. Then decide what happens to the stored decisions under your own retention policy.
Compliance built in
Audited, certified and attested.
We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center
- Regulation encoded into your flows
Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.
- Ready for AMLR
Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.
- Tested in Spain's Treasury sandbox
Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.
- Audited, not self-declared
iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.
Your obligations · 3 regions
SOC 2 Type 2
ISO 27001
iBeta Level 1 and Level 2
EU regulator attestation
FSM youth protection
GDPR
EBA remote onboarding
MiCA compatible
FIDO Alliance member
- AMLREU AML Regulation ready
Integration · Didit MCP
Run Didit from your own AI agent
Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.
- Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
- Run investigationsAsk why a session was declined, review cases, search people and companies.
- Change rulesCreate payment rules, test them on past data and switch them on.
- Pull reportsAsk for numbers, exports or the audit log.
Didit Academy


