v2client Integration Guide
Integrate okID verification into your application using the v2client portal. Complete server-to-server integration in under 15 minutes.
Prerequisites
okID Dashboard Access
Access to v2dashboard to create and manage API keys
Server Environment
Any server that can make HTTP requests (Node.js, Python, PHP, Go, etc.)
v2client Portal URL
The hosted v2client instance URL (e.g., https://verify.test.okid.io)
How v2client Integration Works
1. Get API Key
Create API key in v2dashboard
2. Generate Verification
Server calls v2client with API key
3. Redirect User
User completes verification in portal
Your Server → v2client Portal → okID Backend │ │ │ │ 1. POST │ 2. Create │ │ /generate- │ verification │ │ verification │ using API key │ │ + API key ────┼───────────────▶│ │ │ │ │ 3. Redirect │ 4. User │ │ user to │ verification │ │ portal ──────▶│ flow ─────────▶│
1Get Your API Key
Create an API key in the v2dashboard. This key authenticates your server when generating verification IDs.
Security Requirements
API keys are for server-side use only. Never expose them in client-side code, URLs, or logs.
Creating Your API Key:
- Log into your v2dashboard
- Navigate to the "API Keys" section
- Click "Create API Key"
- Configure verification modules (document, liveness, form_data)
- Set retention period and other settings
- Save the API key securely in your server environment
Store Securely
Store your API key as an environment variable or in a secure configuration system.
# Environment variable (recommended) API_KEY=your-api-key-here V2CLIENT_URL=https://verify.test.okid.io
2Generate Verification ID
When a user needs to verify their identity, your server makes a request to the v2client portal to generate a verification ID.
Server-Side Only
This step must be performed on your server. API keys are never sent to browsers.
API Endpoint:
POST {v2client_url}/api/generate-verification Headers: Content-Type: application/json X-SDK-Key: your-api-key-here Response: { "verificationId": "ver_abc123...", "expiresAt": "2024-01-01T12:00:00Z", "modules": {...}, "flow": ["terms", "document", "liveness"] }
Example Implementation:
Node.js / Express:
app.post('/verify-user', async (req, res) => { try { // Generate verification ID using your API key const response = await fetch(`${process.env.V2CLIENT_URL}/api/generate-verification`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-SDK-Key': process.env.API_KEY } }); if (!response.ok) { throw new Error('Failed to generate verification'); } const { verificationId } = await response.json(); // Redirect user to v2client portal const verifyUrl = `${process.env.V2CLIENT_URL}/verify?verification_id=${verificationId}`; res.redirect(verifyUrl); } catch (error) { res.status(500).json({ error: 'Verification generation failed' }); } });
Python / Flask:
import os import requests from flask import redirect @app.route('/verify-user', methods=['POST']) def verify_user(): try: # Generate verification ID using your API key response = requests.post( f"{os.getenv('V2CLIENT_URL')}/api/generate-verification", headers={ 'Content-Type': 'application/json', 'X-SDK-Key': os.getenv('API_KEY') } ) response.raise_for_status() verification_data = response.json() verification_id = verification_data['verificationId'] # Redirect user to v2client portal verify_url = f"{os.getenv('V2CLIENT_URL')}/verify?verification_id={verification_id}" return redirect(verify_url) except Exception as e: return {'error': 'Verification generation failed'}, 500
PHP:
<?php function generateVerification() { $v2clientUrl = $_ENV['V2CLIENT_URL']; $apiKey = $_ENV['API_KEY']; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "$v2clientUrl/api/generate-verification"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', "X-SDK-Key: $apiKey" ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode === 200) { $data = json_decode($response, true); $verificationId = $data['verificationId']; // Redirect user to v2client portal $verifyUrl = "$v2clientUrl/verify?verification_id=$verificationId"; header("Location: $verifyUrl"); exit; } else { http_response_code(500); echo json_encode(['error' => 'Verification generation failed']); } } ?>
3User Verification Flow
After redirecting the user to the v2client portal, they will complete the verification process automatically.
What Happens Next:
- User lands on the v2client verification portal
- Portal validates the verification ID
- User completes verification modules (terms, document, liveness, forms)
- Results are processed and stored
- User sees completion status
- Verification results appear in your v2dashboard
Example User Journey:
URL: https://verify.company.com/verify?verification_id=ver_abc123
Step 1: Accept terms of service
Step 2: Upload ID document (front/back)
Step 3: Take selfie for liveness detection
Step 4: Fill any additional form data
Step 5: Verification complete!
Checking Results
All verification results appear in your v2dashboard under the "Verifications" section. You can also use webhooks or polling to get results programmatically.
Testing Your Integration
Quick Test Checklist:
Ready for Production
Once your test verification completes successfully, your integration is ready for production use!