4.8.14 • Published 1 year ago

gbc-test-2 v4.8.14

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

KYC Kit

Components to make a complete secure onboarding

Library installation

  • Run npm i gbc-test-2

or

  • Run yarn add gbc-test-2

Import CSS component with:

import "../node_modules/gbc-test-2/dist/style.css";

Import components using:

import { BlackList, LivenessCheck, DocumentReader } from "gbc-test-2";

Important For all components, you should send a token, this token have 1 hour expiration, and this token you could get from getAccessToken method, you have an example here👇

import axios from "axios";

const TOKEN = "**************"; //Bearer Token, Global Bridge Connections send you for email
const clientId = "**************"; //Client ID, Global Bridge Connections send you for email
// Is recommended manage this value for env

async function getAccessToken() {
  const customHeaders = {
    "Content-Type": "application/json",
    Authorization: TOKEN,
  };

  const parseReq = {
    method: "POST",
    url: "https://services.globalbridgeconnections.com.py/oauth/access-token",
    headers: customHeaders,
    data: {
      grant_type: "client_credentials",
    },
  };

  try {
    const res = await axios(parseReq);
    const { access_token } = res.data;
    return access_token;
  } catch (error) {
    throw new error("Error getting Token");
  }
}

Important If you use this components with TypeScript, you should create a customType.d.ts with: declare module 'gbc-test-2'

PropsTypeValuesDescription
inProductionstringprd, stg, devIsn't required, the default value is "prd". You should use "dev" to test integration and then pass to "stg". This env return real data, finally you can delete this prop or change to "prd"
modestringdark, lightIsn't required, the default value is "light".
clientIdstringGlobal Bridge Connections send you for emailThis value is unique for each client and will be sent for email.
authorizepromise() => Promise()This Function verify clientId vs TOKEN and return accessToken.

Document Reader Component

import { DocumentReader } from "gbc-test-2";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • loader: bool default is false
const getDataDocument = async (info) => {
  if (info) {
    console.log(info.data);
  }
};
// This component return data and you can get it with getDataDocument function.

<DocumentReader
  dataDocument={getDataDocument}
  clientId={clientId}
  authorize={getAccessToken}
  inProduction="prd"
/>;

Liveness Component

import { BlackList } from "gbc-test-2";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • loader: bool default is false
const listener = (event) => {
    console.log(event)
    if (event.detail) {
      if (event.detail.action === 'PROCESS_FINISHED') {
        const { response } = event.detail.data
        console.log(response)
      }
    }
  }

useEffect(() => {
    const component = document.getElementsByTagName('face-liveness')[0]
    if (component) {
      component.addEventListener('face-liveness', listener)
    }
  }, [listener])

<LivenessCheck
    clientId={clientId}
    authorize={getAccessToken}
    inProduction="prd"
/>

BlackList Component

import { BlackList } from "gbc-test-2";
<BlackList
  clientId={clientId}
  authorize={getAccessToken}
  inProduction="prd" // Default value is prd, not is required
  mode="dark" // Default value is light, not is required
/>
4.8.9

1 year ago

4.8.10

1 year ago

4.8.12

1 year ago

4.8.11

1 year ago

4.8.14

1 year ago

4.8.13

1 year ago

4.5.3

2 years ago

4.4.1

2 years ago

4.4.0

2 years ago

4.4.3

2 years ago

4.4.2

2 years ago

4.8.8

1 year ago

4.8.5

1 year ago

4.8.4

1 year ago

4.8.7

1 year ago

4.8.6

1 year ago

4.8.1

1 year ago

4.8.0

1 year ago

4.4.4

2 years ago

4.8.3

1 year ago

4.8.2

1 year ago

4.3.2

2 years ago

4.3.1

2 years ago

4.2.10

2 years ago

4.7.0

2 years ago

4.3.4

2 years ago

4.3.3

2 years ago

4.3.0

2 years ago

4.7.9

1 year ago

4.7.6

1 year ago

4.7.5

1 year ago

4.3.9

2 years ago

4.7.8

1 year ago

4.7.7

1 year ago

4.7.2

1 year ago

4.3.6

2 years ago

4.7.1

2 years ago

4.3.5

2 years ago

4.7.4

1 year ago

4.3.8

2 years ago

4.7.3

1 year ago

4.3.7

2 years ago

4.2.3

2 years ago

4.2.5

2 years ago

4.6.0

2 years ago

4.2.4

2 years ago

4.6.7

2 years ago

4.6.6

2 years ago

4.6.9

2 years ago

4.6.3

2 years ago

4.2.7

2 years ago

4.6.2

2 years ago

4.2.6

2 years ago

4.6.5

2 years ago

4.2.9

2 years ago

4.6.4

2 years ago

4.2.8

2 years ago

4.6.11

2 years ago

4.5.0

2 years ago

4.5.2

2 years ago

4.6.10

2 years ago

4.5.1

2 years ago

4.1.8

2 years ago

4.1.7

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.6

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.2.1

2 years ago

4.0.3

2 years ago

4.2.0

2 years ago

4.0.2

2 years ago

4.1.4

2 years ago

4.1.3

2 years ago

4.1.6

2 years ago

4.1.5

2 years ago

4.1.0

2 years ago

4.1.2

2 years ago

4.1.1

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.1.1

2 years ago

3.0.2

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.1.4

2 years ago

3.0.0

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago