If you're working on a new integration, please use our React Native Wrapper instead.
This Berbix React Native library provides simple interfaces to interact with the Berbix Verify flow.
This library is dependent on the react-native-camera component. Due to this dependency, you may need to follow their more detailed installation instructions if the basic instructions here are insufficient.
npm install berbix-react-native
react-native link react-native-camera
Add the following line to android/app/build.gradle
in the defaultConfig
block.
missingDimensionStrategy 'react-native-camera', 'general'
Add an entry for camera access to your Info.plist
for iOS access.
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first time</string>
import React from "react";
import BerbixVerify from "berbix-react-native";
class ExampleComponent extends React.Component {
render() {
return (
<BerbixVerify
clientId="your_client_id"
onComplete={event => {
// send event.value to backend to fetch user verification data
}}
/>
);
}
}
BerbixVerify.propTypes = {
// Required
clientId: PropTypes.string.isRequired,
// Configurations
templateKey: PropTypes.string,
clientToken: PropTypes.string,
// Event handlers
onComplete: PropTypes.func.isRequired,
onError: PropTypes.func,
onDisplay: PropTypes.func,
onStateChange: PropTypes.func
};
# Update the version in package.json
npm run build
npm publish