orbaone / web-sdk

The official Orba One Web SDK
MIT License
1 stars 1 forks source link
javascript vanilla-javascript web-sdk


Orba One

To integrate the Orba One SDK, follow this guide and use your own API Key which you can obtained from the developer dashboard.


npm version


The integration of the Orba One Web SDK follows these simple steps:

  1. Install the SDK through NPM / Yarn
  2. Get an API Key
  3. Render the Orba One verification button and handle the result

Additionally, there is a non package manager installation option. You can start using Orba One SDK library by directly by including it in your HTML file. Instructions can be found here.

1. Install the SDK

# Yarn
yarn add @orbaone/core

# NPM
npm install --save @orbaone/core

2. Get an API Key

Orba One uses API keys to allow access to the API and show onboarded users in your dashboard. Login to your Orba One account and create a new Orba One API key form your Developer Dashboard.

3. Render the verification button

Import the Orba One SDK

import { renderButton } from "@orbaone/core";

Example Usage (Applicant Verification)

renderButton({
  apiKey: "exampleAPIKey",
  target: "#button",
  applicantId: "",
  disableStyle: false,
  useAudioInstructions: false,
  onSuccess: (data) => {console.log(data)},
  onError: (err) => {console.log(err)},
  onCancelled: (state) => {console.log(state);},       
})

Example Usage (Company Verification)

renderButton({
  apiKey: "exampleAPIKey",
  target: "#button",
  companyId: "",
  disableStyle: false,
  useAudioInstructions: false,
  onSuccess: (data) => {console.log(data)},
  onError: (err) => {console.log(err)},
  onCancelled: (state) => {console.log(state);},       
})

renderButton(config) Options

Parameter Type Description
target string or DOMElement The DOM element you want to mount the button on.
apiKey string The OrbaOne Key you obtained from the dashboard.
applicantId string (optional) The id of the applicant being verified
companyId string (optional) The id of the company being verified
apiKey string The OrbaOne Key you obtained from the dashboard.
disableStyle boolean (optional) Disables styling.
useAudioInstructions boolean (optional) Specifies whether or not to use audio instructions.
onSuccess function Callback function that is triggered after onboarding is complete.
onError function Callback function that is triggered if onboarding has failed.
onCancelled function Callback function that is triggered when the state of the button changes.
steps array Array of verification steps.

Browser

OrbaOne is available over unpkg CDN

<script type="text/javascript" defer="true" src="https://unpkg.com/@orbaone/core" />

Example Usage

<script type="text/javascript">
    // Verifying An Applicant
    OrbaOne.renderButton({
        apiKey: "exampleAPIKey",
        target: "#button",
        applicantId: "",
        disableStyle: false,
        useAudioInstructions: false,
        onSuccess: (data) => {
            console.log(data);
        },
        onError: (err) => {
            console.log(err);
        },
        onChange: (state) => {
             console.log(state);
        },
        steps: ["welcome"],
    });

    // Verifying A Company
    OrbaOne.renderButton({
        apiKey: "exampleAPIKey",
        target: "#button",
        companyId: "",
        disableStyle: false,
        useAudioInstructions: false,
        onSuccess: (data) => {
            console.log(data);
        },
        onError: (err) => {
            console.log(err);
        },
        onChange: (state) => {
             console.log(state);
        },
        steps: ["welcome"],
    });
</script>