Getting Started
Go from zero to a working verification flow in under 10 minutes.
1
Get your API key
Create a Base360 account and generate an API key from the dashboard. Use b360_test_sk_* keys in development and b360_live_sk_* keys in production.
Dashboard
1. Sign in to the Base360 Dashboard at https://dashboard.base360.io
2. Navigate to Settings > API Keys
3. Click "Create API Key"
4. Copy your key — it will only be shown once
Your key looks like: b360_live_sk_xxxxxxxxxxxxxxxx2
Create a verification
A verification represents a single identity check session. Specify which checks to run and where to send results.
import { Base360 } from '@base360/sdk';
const client = new Base360({ apiKey: process.env.BASE360_API_KEY });
const verification = await client.verifications.create({
type: 'identity',
reference_id: 'user_12345',
checks: ['document_ocr', 'face_match'],
redirect_url: 'https://your-app.com/verify/complete',
webhook_url: 'https://your-app.com/api/webhooks/base360',
});
// verification.id -> "ver_abc123"
// verification.url -> "https://verify.base360.io/s/abc123"
// verification.status -> "pending"3
Upload documents
You can either redirect users to the hosted verification flow (recommended) or upload documents server-side via the API.
// If you need to upload documents server-side instead of
// using the hosted verification flow:
const fs = require('fs');
const document = await client.documents.upload(verification.id, {
type: 'passport',
side: 'front',
file: fs.createReadStream('./passport-front.jpg'),
});
// For face matching, upload a selfie
const selfie = await client.documents.upload(verification.id, {
type: 'selfie',
file: fs.createReadStream('./selfie.jpg'),
});
// Trigger processing
await client.verifications.submit(verification.id);4
Handle webhook results
Base360 sends webhook events when verifications complete. Always verify the webhook signature before processing.
import crypto from 'crypto';
// Express / Fastify webhook handler
app.post('/api/webhooks/base360', (req, res) => {
// Verify webhook signature
const signature = req.headers['x-base360-signature'];
const expected = crypto
.createHmac('sha256', process.env.BASE360_WEBHOOK_SECRET)
.update(JSON.stringify(req.body))
.digest('hex');
if (signature !== expected) {
return res.status(401).send('Invalid signature');
}
const { event, data } = req.body;
switch (event) {
case 'verification.completed':
console.log('Verification result:', data.status); // "approved" | "declined"
console.log('Checks:', data.checks);
// Update your user record
break;
case 'verification.failed':
console.log('Verification failed:', data.reason);
break;
}
res.status(200).send('OK');
});