Quick Start
Get started with VerifyID - install the script, generate a device ID, and verify users in four steps.
Introduction
VerifyID is an age verification API built around MitID and BankID. It uses a hosted verification flow - you redirect users in, we verify them, and redirect back with a token you validate server-side.
The entire integration is four steps:
- Install the client script
- Generate a verification URL
- Redirect the user into the hosted flow
- Check the returned token server-side
Install the Script
Add the VerifyID device script to your page. This auto-generates and stores a unique device_id in the browser's localStorage.
device_id -> UUID4()
<script src="https://app.verifyid.dk/static/data/device_id.js"></script>Once loaded, read the device ID:
const device_id = localStorage.getItem('verifyid_device_id');The script must load before you attempt to read verifyid_device_id. Place it in <head> or before your application code or just generate random uuid4().
Get Your Plugin Key
Your pluginKey is available on the VerifyID Dashboard. Each key is tied to your account and your verified domains.
Integration Flow
Install the script
Load device_id.js in your HTML. The script writes verifyid_device_id to localStorage automatically.
<script src="https://app.verifyid.dk/static/data/device_id.js"></script>Generate the verification URL
Choose the right endpoint for your verification provider:
| Provider | Endpoint |
|---|---|
| MitID | /api/url_generator_s/{pluginKey}/{device_id}/{age} |
| BankID | /api/url_generator_bankid/{pluginKey}/{device_id}/{age} |
Pass the domain query parameter - this is where the user returns after verification.
const device_id = localStorage.getItem('verifyid_device_id');
const domain = window.location.origin + window.location.pathname;
const pluginKey = 'verifyid_test';
const age = 18; // or 16
window.location.href =
`https://app.verifyid.dk/api/url_generator_s/${pluginKey}/${device_id}/${age}?domain=${domain}`;User completes verification
The user is taken through the hosted MitID or BankID flow. After completion (success or failure), they are redirected back to your domain with a token:
https://yoursite.com/checkout?token_age_verified=xyzCapture this token:
const token = new URLSearchParams(window.location.search)
.get('token_age_verified');Validate server-side
Call the auth check endpoint from your server (not the browser) to verify the token:
curl https://app.verifyid.dk/api/auth_check/{token_age_verified}/{device_id}Response:
{
"age": 18
}The age field returns 16, 18, or null (not verified).