Get unlimited public & private packages + team-based management with npm Teams.Learn more »

berbix-react-native

0.1.7 • Public • Published

Berbix React SDK

This Berbix React Native library provides simple interfaces to interact with the Berbix Verify flow.

Installation

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.

Install the SDK

npm install berbix-react-native

Set up dependencies

react-native link react-native-camera

Add the following line to android/app/build.gradle in the defaultConfig block.

missingDimensionStrategy 'react-native-camera', 'general'

Set up permissions

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>

Usage

Basic usage

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
        }}
      />
    );
  }
}

Full propTypes

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
};

Publishing

# Update the version in package.json
npm run build
npm publish

Install

npm i berbix-react-native

DownloadsWeekly Downloads

158

Version

0.1.7

License

MIT

Unpacked Size

24.7 kB

Total Files

3

Last publish

Collaborators

  • avatar
  • avatar
  • avatar