1.12.0 ā€¢ Published 18 days ago

gbc-kyc-kit v1.12.0

Weekly downloads
-
License
MIT
Repository
-
Last release
18 days ago

KYC Kit

Components to make a complete secure onboarding. Global Bridge Connections KYC Kit can read more than 100 countries documents. Ask for your Client ID writing to servicios@globalbridgeconnections.com.py How work it? You can see our documentation https://global-bridge-connections-paragu.gitbook.io/dashboard-kyc/

Library installation

  • Run npm i gbc-kyc-kit

or

  • Run yarn add gbc-kyc-kit

Import CSS component with:

import "../node_modules/gbc-kyc-kit/dist/style.css";

Style customization

You could customize all styles of components, just need make reference to the label of component as follows:

Important Remember that you can use mode prop to turn between dark or light mode without change styles.

CSS/SASS/SCSS

/* Rest of code */
:root {
  --primary: #1976d2;
  --primary-hov: #2689ed;
  --secondary: #e8edff;
  --text-button-color: #fff;
  --secondary: #e8edff;
  --warning: #f8bb86;
  --success: #4caf50;
  --error: #ff1199;
  --text-color: #8c8c8c;
  --title-color: #262626;
  --font-family: "Poppins", sans-serif;
}

Import components using:

import {
  BlackList,
  LivenessCheck,
  DocumentReader,
  FaceMatch,
} from "gbc-kyc-kit";

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"; //Remember to have it installed

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 into src folder with: declare module 'gbc-kyc-kit'

PropsTypeValuesDescription
inProductionstringprd, stg, dev, sandIt isn'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, lightIt isn'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.
picBase64stringIs required. It would be used to compare the selfie image with this picture
countryCodeAllowedarray of stringIt isn't required. If exist these props, the component will validate the client geolocation vs the code country thay is used as country allowed. You can use several countries but remember to use the country code aording to the ISO
validateVpnbooleanIt isn't required. If exist these props, the component will validate the use of VPN. The default value is false
dualModeRequiredbooleanIt isn't required. Only apply to OCR Component. If exist these props, the component will be forced to upload two side of docuemnt. The default value is false
successMessagestringIt isn't required. If exist these props, the component will take this message, else we use the default values for each component
alertMessagestringIt isn't required. If exist these props, the component will take this message, else we use the default values for each component, Only apply to Blacklist Component
faceMatchstringIt isn't required. If exist these props, should be an image in base64 or url, the component will to compare this image with the liveness check. The default vaue is null

Document Reader Component

import { DocumentReader } from "gbc-kyc-kit";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • inProduction: string default is prd
  • dataDocument: function to get response
  • countryCodeAllowed: array of string
  • dualModeRequired: boolean
  • validateVpn: boolean
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"
  successMessage="Documento agregado con Ć©xito"
/>;

Liveness Component

import { LivenessCheck } from "gbc-kyc-kit";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • inProduction: string default is prd
  • countryCodeAllowed: array of string
  • dataLiveness: function to get response
  • faceMatch: base64 to compare with Liveness, if it's null, just will validate Liveness else will validate Liveness first and then face match.
  • validateVpn: boolean
const getDataLiveness = async (info) => {
  if (info) {
    console.log(info.data);
  }
};
// This component return data and you can get it with getDataLiveness function.
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}
    dataLiveness={getDataLiveness}
    inProduction="prd"
    faceMatch={base64Image}
    successMessage="Selfie procesada con Ć©xito"
/>

BlackList Component

import { BlackList } from "gbc-kyc-kit";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • inProduction: string default is prd
  • countryCodeAllowed: array of string
  • validateVpn: boolean
  • alertMessage: string
<BlackList
  clientId={clientId}
  authorize={getAccessToken}
  inProduction="prd" // Default value is prd, not is required
  mode="dark" // Default value is light, not is required
  successMessage="Persona no encontrada en lista de sanciones"
  alertMessage="Persona existente en lista de sanciones"
/>

Facematch Component

import { FaceMatch } from "gbc-kyc-kit";

Props Available:

  • mode: string 'dark' || 'light' default is 'light'
  • inProduction: string default is prd
  • picBase64: string img to compare with selfie in base64 format
  • dataFaceMatch: function to get response
  • countryCodeAllowed: array of string
  • validateVpn: boolean
const getDataFaceMatch = async (info) => {
  if (info) {
    console.log(info.data);
  }
};// This component return data and you can get it with getDataFaceMatch function.

const picbase64 = " ...This is the base64 image to be compared with the selfie. It would be image of id document or other image of onboarding maybe"

<FaceMatch
  dataFaceMatch={getDataFaceMatch}
  clientId={clientId}
  authorize={getAccessToken}
  inProduction="prd"
  picBase64={picbase64}
  countryCodeAllowed={["PY"]}
  successMessage="ComparaciĆ³n de rostro procesado exitosamente"
/>;
1.12.0

18 days ago

1.11.32

1 month ago

1.11.30

2 months ago

1.11.31

2 months ago

1.11.29

2 months ago

1.11.28

2 months ago

1.11.27

3 months ago

1.11.25

3 months ago

1.11.26

3 months ago

1.11.24

3 months ago

1.11.23

3 months ago

1.11.19

3 months ago

1.11.20

3 months ago

1.11.21

3 months ago

1.11.16

6 months ago

1.11.17

6 months ago

1.11.14

6 months ago

1.11.15

6 months ago

1.11.12

7 months ago

1.11.13

6 months ago

1.11.11

7 months ago

1.11.18

6 months ago

1.10.7

8 months ago

1.10.6

8 months ago

1.11.10

7 months ago

1.11.4

7 months ago

1.11.3

8 months ago

1.11.2

8 months ago

1.11.1

8 months ago

1.11.8

7 months ago

1.11.7

7 months ago

1.11.6

7 months ago

1.11.5

7 months ago

1.11.9

7 months ago

1.11.0

8 months ago

1.10.5

8 months ago

1.10.4

8 months ago

1.10.3

9 months ago

1.10.2

9 months ago

1.9.1

9 months ago

1.9.0

9 months ago

1.10.1

9 months ago

1.10.0

9 months ago

1.9.4

9 months ago

1.9.3

9 months ago

1.9.2

9 months ago

1.8.14

9 months ago

1.8.15

9 months ago

1.8.16

9 months ago

1.8.17

9 months ago

1.8.18

9 months ago

1.6.4

11 months ago

1.6.3

11 months ago

1.6.2

11 months ago

1.6.1

11 months ago

1.6.0

11 months ago

1.7.9

10 months ago

1.7.8

10 months ago

1.7.7

10 months ago

1.7.6

11 months ago

1.7.5

11 months ago

1.6.20

11 months ago

1.6.22

11 months ago

1.6.21

11 months ago

1.6.24

11 months ago

1.6.23

11 months ago

1.6.26

11 months ago

1.6.25

11 months ago

1.6.28

11 months ago

1.6.27

11 months ago

1.6.29

11 months ago

1.6.31

11 months ago

1.6.30

11 months ago

1.6.9

11 months ago

1.6.33

11 months ago

1.6.8

11 months ago

1.6.32

11 months ago

1.6.7

11 months ago

1.6.35

11 months ago

1.6.6

11 months ago

1.6.34

11 months ago

1.6.5

11 months ago

1.6.36

11 months ago

1.8.2

9 months ago

1.8.1

9 months ago

1.8.0

9 months ago

1.6.11

11 months ago

1.5.9

11 months ago

1.6.10

11 months ago

1.5.8

12 months ago

1.6.13

11 months ago

1.5.7

12 months ago

1.6.12

11 months ago

1.5.6

12 months ago

1.6.15

11 months ago

1.6.14

11 months ago

1.6.17

11 months ago

1.6.16

11 months ago

1.6.19

11 months ago

1.6.18

11 months ago

1.7.3

11 months ago

1.7.2

11 months ago

1.7.1

11 months ago

1.7.0

11 months ago

1.8.9

9 months ago

1.8.10

9 months ago

1.8.8

9 months ago

1.8.7

9 months ago

1.8.12

9 months ago

1.8.6

9 months ago

1.8.13

9 months ago

1.8.5

9 months ago

1.8.4

9 months ago

1.8.3

9 months ago

1.5.5

12 months ago

1.5.4

12 months ago

1.3.6

1 year ago

1.5.3

12 months ago

1.5.2

12 months ago

1.5.1

1 year ago

1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago