Registry / auth-security / berbix-vue

berbix-vue

JSON →
library1.0.1jsnpmunverified

The berbix-vue SDK provides a dedicated Vue.js component for integrating the Berbix identity verification flow into web applications. Berbix itself offers a fully automated and instant identity verification solution, leveraging biometric scans combined with data extraction from government-issued IDs (such as driver's licenses and passports) to quickly and accurately confirm user identities. The SDK simplifies the client-side integration of this complex process, handling the user interface and interactions necessary for the verification flow, which includes real-time coaching for optimal image capture and selfie submission. Currently at version 1.0.1, the package is designed to assist developers in building secure onboarding, age verification, and KYC (Know Your Customer) processes within Vue environments. Its core differentiators lie in its high accuracy, exceptionally low false acceptance rate (0.1%), and a rapid 2-second response time for verification results, aiming to optimize both security and user conversion. While the package specifies 'Vue 2.x release support', modern Vue development primarily targets Vue 3, necessitating careful consideration of the specific Vue version used for integration.

npm install berbix-vue
INSTALL
IMPORT
SIG · BERBIX-VUE
B
berbix-vue
auth-securityjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BerbixVerify
import { BerbixVerify } from 'berbix-vue';
import BerbixVerify from 'berbix-vue';
BerbixVerify is the main UI component for rendering the verification flow, exported as a named export. It's typically used directly in a Vue template or registered globally.
BerbixEvent
import type { BerbixEvent } from 'berbix-vue';
For TypeScript projects, import types like BerbixEvent to ensure correct type-checking for event payloads emitted by the BerbixVerify component. The exact type names may vary based on SDK version.
App.use (plugin-like setup)
import { createApp } from 'vue'; import App from './App.vue'; import { BerbixVerify } from 'berbix-vue'; const app = createApp(App); app.component('BerbixVerify', BerbixVerify); app.mount('#app');
const BerbixVerify = require('berbix-vue'); // CommonJS import new Vue().use(BerbixVerify); // Vue 2 plugin pattern for a component-only export
While berbix-vue is primarily a component, for global availability, it can be registered with `app.component` in Vue 3 or directly imported and used in SFCs. CommonJS `require()` is not supported for modern Vue SDKs.

This quickstart demonstrates how to integrate the BerbixVerify component into a Vue 3 application using the Composition API. It shows how to pass a clientToken, handle completion and error events, and display the verification status. Remember to obtain `clientToken` securely from your backend.

<!-- src/App.vue --> <script setup lang="ts"> import { ref } from 'vue'; import { BerbixVerify } from 'berbix-vue'; import type { BerbixEvent } from 'berbix-vue'; // Assuming BerbixEvent type exists // IMPORTANT: Replace with a valid, secure clientToken obtained from your backend. // Never expose sensitive tokens directly in your frontend code. const clientToken = ref('YOUR_BERBIX_CLIENT_TOKEN_FROM_BACKEND'); const verificationStatus = ref('Pending'); const handleVerificationComplete = (event: BerbixEvent) => { console.log('Berbix verification complete:', event); // event.status could be 'accepted', 'rejected', 'expired', etc. verificationStatus.value = event.status; alert(`Verification finished with status: ${event.status}`); // Typically, you would send this event data to your backend for server-side verification. // fetch('/api/berbix-webhook', { method: 'POST', body: JSON.stringify(event) }); }; const handleError = (error: any) => { console.error('Berbix verification error:', error); verificationStatus.value = 'Error'; alert(`Verification error: ${error.message || 'Unknown error'}`); }; // Example: Logic to refresh the client token and re-initiate verification if needed const refreshVerification = () => { console.log("Attempting to refresh client token and re-initiate verification..."); // In a real application, this would involve an API call to your backend // to fetch a new clientToken. Update clientToken.value when ready. clientToken.value = 'NEW_CLIENT_TOKEN_FROM_BACKEND'; // Placeholder for new token verificationStatus.value = 'Pending'; // Reset status }; </script> <template> <div id="app-container"> <h1>Berbix Identity Verification</h1> <p>Current Status: <strong>{{ verificationStatus }}</strong></p> <div v-if="verificationStatus === 'Pending' || verificationStatus === 'Error'"> <p>Please complete the identity verification process.</p> <div class="berbix-widget-container"> <BerbixVerify :clientToken="clientToken" @complete="handleVerificationComplete" @error="handleError" :key="clientToken" <!-- Use key to force component re-render if clientToken changes --> /> </div> <button v-if="verificationStatus === 'Error'" @click="refreshVerification" style="margin-top: 20px;">Try Verification Again</button> </div> <div v-else-if="verificationStatus === 'accepted'"> <p>Verification flow successfully completed. You can now proceed.</p> <!-- Further application logic after successful verification --> </div> <div v-else> <p>Verification flow ended with status: {{ verificationStatus }}.</p> </div> </div> </template> <style> #app-container { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-align: center; color: #2c3e50; margin-top: 60px; } .berbix-widget-container { border: 1px solid #eee; padding: 20px; margin: 20px auto; max-width: 600px; min-height: 400px; /* Give some space for the widget */ display: flex; justify-content: center; align-items: center; } </style> <!-- src/main.ts --> <!-- import { createApp } from 'vue'; import App from './App.vue'; createApp(App).mount('#app'); -->
Debug
Known issues
breakingThe package explicitly notes 'Vue 2.x release support'. Given Vue 2 reached End-of-Life on December 31, 2023, integrating with Vue 2 might lead to security vulnerabilities or lack of future compatibility with other modern libraries. Developers should verify compatibility if targeting Vue 3, as breaking changes exist between Vue 2 and 3.
fix
For new projects, prefer Vue 3 and confirm SDK compatibility. If maintaining a Vue 2 project, ensure the SDK's Vue 2 support is actively maintained and consider the implications of Vue 2 EOL. Migration to Vue 3 would involve refactoring your application and potentially updating the SDK version.
affects: >=1.0.0
gotchaThe Berbix verification flow often requires users to use a mobile device to scan their ID documents and take a selfie. Users initiating the flow on a desktop computer will typically be prompted to switch to a mobile device for these steps, which can impact user experience if not properly communicated upfront.
fix
Inform users about the mobile device requirement before they start the verification process. Provide clear instructions and options for seamlessly transitioning to a mobile device (e.g., QR code, email/SMS link).
affects: >=1.0.0
gotchaThe `clientToken` prop is a critical security credential that should be generated and managed on your backend server. Exposing it directly in frontend code or fetching it insecurely can lead to unauthorized access to your Berbix account and potential fraud.
fix
Always fetch the `clientToken` from your secure backend via an authenticated API endpoint. The token should have a limited lifespan and be tied to the user session. Never hardcode it or embed it directly into static client-side bundles.
affects: >=1.0.0
gotchaBerbix was acquired by Socure in June 2023. While the `berbix-vue` SDK continues to function, this acquisition might lead to future changes in branding, API endpoints, support channels, or the introduction of new SDK versions that may not be fully backward compatible.
fix
Stay informed about official announcements from Berbix/Socure regarding product roadmaps, API changes, and migration guides. Regularly check the package's GitHub repository and npm page for updates and deprecation notices.
affects: >=1.0.0
Errors
Common errors & fixes
[Vue warn]: Failed to resolve component: BerbixVerify
The `BerbixVerify` component has not been correctly registered with your Vue application, or you're attempting to use it without explicit import in a Single File Component (SFC).
fix
Ensure you `import { BerbixVerify } from 'berbix-vue';` in your component's script section (especially with `<script setup>`) or globally register it using `app.component('BerbixVerify', BerbixVerify);` in your `main.ts`/`main.js`.
Error: Invalid clientToken provided. Please check your token.
The `clientToken` passed to the `BerbixVerify` component is either missing, expired, malformed, or not recognized by the Berbix API.
fix
Verify that your backend correctly generates and provides a fresh, valid `clientToken` for each user session. Ensure the token is passed correctly to the `:clientToken` prop of the `BerbixVerify` component. Check your Berbix dashboard for token validity and API key configurations.
TypeError: Cannot read properties of undefined (reading 'status') in handleVerificationComplete
The `event` object received by your `@complete` or `@error` handler might not have the expected structure, or the `status` property is missing, often due to an outdated SDK version or an unexpected API response.
fix
Consult the official Berbix SDK documentation for the exact structure of the `complete` and `error` event payloads. Update your event handlers to safely access properties (e.g., `event?.status`) and ensure your `berbix-vue` package is up to date.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
vuerequiredPeer dependency as this is a Vue.js SDK component.
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
berbix-vue — npm install berbix-vue · libregistry