SDK Integration
Seamlessly embed the Owl Eyes verification flow directly into your web application.
Installation
Install the Owl Eyes SDK via npm or yarn.
npm install @owl-eyes/web-sdkOr include via CDN:
<script src="https://sdk.owl-eyes.com/v1/owl-eyes.js"></script>Usage Guide
Vanilla JavaScript
import OwlEyes from '@owl-eyes/web-sdk';
// Initialize the SDK
const owl = new OwlEyes({
apiKey: 'pk_live_...',
});
// Start verification
owl.startVerification({
containerId: 'verification-container',
onComplete: (result) => {
console.log('Verification completed:', result);
// result.status: 'verified' | 'review_required' | 'failed'
// result.verificationId: 'v_12345...'
},
onError: (error) => {
console.error('Verification error:', error);
}
});React
import { OwlEyesProvider, useVerification } from '@owl-eyes/react-sdk';
export default function VerificationPage() {
const { start } = useVerification();
const handleVerify = () => {
start({
onComplete: (data) => alert('Verified!'),
});
};
return (
<button onClick={handleVerify}>
Verify Identity
</button>
);
}Vue.js
<template>
<div id="owl-eyes-container"></div>
</template>
<script>
import OwlEyes from '@owl-eyes/web-sdk';
export default {
mounted() {
this.owl = new OwlEyes({ apiKey: 'pk_live_...' });
this.owl.mount('#owl-eyes-container', {
onComplete: this.handleComplete
});
},
methods: {
handleComplete(result) {
console.log(result);
}
}
}
</script>Iframe Embedding
For frameworks not listed or for simple HTML sites, you can use an iframe.
<iframe
src="https://verify.owl-eyes.com/embed/v_token_..."
width="100%"
height="600px"
allow="camera"
style="border: none; border-radius: 8px;">
</iframe>Configuration Options
The startVerification method accepts the following options:
| Parameter | Type | Description |
|---|---|---|
| containerId | string | ID of the DOM element to mount the SDK into. |
| flowType | string | 'document' | 'standard' | 'enhanced' |
| theme | object | Customize primaryColor, textColor, etc. |
| metadata | object | Key-value pairs to attach to this verification (e.g. userId). |