Get started
This page demonstrates how to configure your account to use the SDK, as well as how to install and configure it in your project.
CONFIGURATION OF CONTENT SECURITY POLICY (CSP)
The Web SDK employs the use of Web Workers to improve security and performance. Therefore, you need to add the following settings to your Content Security Policy (CSP)
<meta
http-equiv="Content-Security-Policy"
content="
script-src 'self' 'unsafe-eval' *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app;
worker-src 'self' blob:;
child-src 'self' blob:;
style-src 'self' 'unsafe-inline' *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app;
font-src 'self' https://fonts.gstatic.com *.acesso.io *.unico.run *.unico.io *.unico.app;
img-src 'self' data: blob: *.acesso.io *.unico.run *.unico.io *.unico.app;
media-src 'self' data: *.acesso.io *.unico.run *.unico.io *.unico.app;
script-src-elem 'self' 'unsafe-inline' blob: *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app"
/>
If your application has a CSP configured, this setting is mandatory.
Configure your credentials
To use the SDK, you need to get valid credential keys. The following steps show you how to get these client keys and configure it in your project:
Get your credentials
To use the WEB SDK you need to obtain the SDK Key credential, a unique customer identification key generated by the Unico team.
- contact the CSs and/or Onboarding team.
- Request the SDK Key by entering the identifiers of your applications. Bundle Identifier for iOS, PackageID for Android and Host for WEB.
- The identifiers of your applications will be linked to the SDK Key by the Unico team.
- You receive your SDK Key to implement the AccessBioConfigDataSource.
Credentials (Client API Key) - Deprecated Method
To import the credentials (Client API Key) into your project, use the following guide:
- Log in to the Unico Customer Area;
- Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;
- Generate or edit an existing
API Key
; - If you want to use the Smartlive with interaction functionality in your app, check if the field "Utiliza liveness com interação" is enabled (this field must be showing you the word "SIM"). Otherwise, contact the support team to request the activation.
Learn more about Smartlive with interaction in the key concepts section.
- Select SIM (Yes) in the field "Utiliza autenticação segura na SDK" (Asking if use secure authentication in SDK);
- Expand the JS SDK section and add your application name and the hostname (including http or https);
- Save your changes.
Add the credentials to your app
- Log in to your Customer Area;
- Go to Configurações (Configurations), then Integração (Integrations) and finally to API Key;
- Select the Download option on the desired API Key;
- Select the JS option;
- Click on "Gerar";
- A new tab will open in your browser containing project information in JSON format..
You may need to temporarily disable your pop-up blocker to see the download window.
- Save the content of this new tab in a JSON file;
- Keep the file to add it in your project latter. This configuration is explained latter in this SDK guides.
The JSON file must be in a public, web-accessible location within your project.
EMBARKING CREDENTIALS INTO YOUR PROJECT
To add the SDK Key to the project, implement the UnicoConfig class.
import { UnicoConfig } from "unico-webframe"
const config = new UnicoConfig()
.setHostname("<YOUR_HOSTNAME>")
.setHostKey("<YOUR_HOST_KEY>");
Embed additional Unico Check files in your project
This step is optional and depends on the configuration you use in your project.
The table below lists additional resource files available for inclusion in your project. You must download and include them in your project depending on the features you want to use. Additional features of unico check for FaceTec proof of life capture with interaction:
SDK Release | FaceTec Release (Click on the number to download additional files) |
---|---|
3.18.9 | 9.7.36 |
3.18.8 | 9.7.33 |
3.18.7 | 9.7.31 |
3.18.4 | 9.7.25 |
3.18.0 -> 3.18.3 | 9.6.92 |
3.16.4 -> 3.17.0 | 9.6.89 |
3.16.3 | 9.6.85 |
3.16.2 | 9.6.84 |
3.14.1 -> 3.16.1 | 9.6.73 |
3.11.1 -> 3.14.0 | 9.6.65 |
3.10.2 -> 3.11.0 | 9.6.56 |
3.10.1 | 9.6.53 |
3.9.1 -> 3.10.0 | 9.6.40 |
3.9.0 | 9.6.38 |
3.8.3 | 9.6.33 |
3.8.2 | 9.6.30 |
3.8.0 -> 3.8.1 | 9.6.26 |
3.7.1 -> 3.7.2 | 9.6.24 |
3.6.5 -> 3.7.0 | 9.6.16 |
3.6.3 -> 3.6.4 | 9.6.11 |
3.6.1 -> 3.6.2 | 9.6.4 |
3.5.4 -> 3.6.0 | 9.4.18 |
3.5.3 | 9.4.14 |
3.5.0 -> 3.5.2 | 9.4.11 |
To download the AI file of the unico check Web SDK click here.
The above files also must be in a public, web-accessible location within your project.
Installation
Install the SDK from npm or cdn:
Use the Unico Check npm package, or embed the Unico Check script (from CDN) into your js files:
We suggest you to always keep the SDK updated to its latest version. You can check the most recent version at the Release notes.
Installation through npn or yarn packages
Using npn:
npm install unico-webframe
Using yarn:
yarn add unico-webframe
Installation through CDN
Download the file and import it in your project:
- Download version
3.18.9
To use the Smart camera functionality, you must include the IA models in your projects, so that everything works fine. To achieve this, download the file and add it to your project.
The models must be available in a public folder named models
, through the application base path. Example: https://www.yourdomain.com/models
or https://localhost:8000/models
.
Import the files
Import Unico Check SDK in your application, depending on the installation mode:
Installed using npm or yarn packages
import { UnicoCheckBuilder, SelfieCameraTypes, UnicoThemeBuilder, DocumentCameraTypes, UnicoConfig, LocaleTypes } from 'unico-webframe'
Installed using cnd
import { UnicoCheckBuilder, SelfieCameraTypes, UnicoThemeBuilder, DocumentCameraTypes, UnicoConfig, LocaleTypes } from 'UnicoCheckBuilder.min.js'
Rendering
The rendering method depends on if you have enabled Smart live with interaction or no.
If you are not using Smartlive with interaction FaceTec
O frame para captura será renderizado dentro de um div
que deverá possuir seu id
necessáriamente igual a "box-camera"
.
Create a DOM container element on your page (div
) where you want the capture frame to be rendered. Make sure to name the container element as "box-camera"
.
Exemplo:
<div id="box-camera"></div>
Make sure your div id is equal to 'box-camera'
, otherwise the frame won't load.
If you are using Smartlive with interaction FaceTec
If you have configured Smartlive with interaction FaceTec in your project, you don't need to create a placeholder in your code to render the frame. In this case, Unico Check SDK opens a modal that takes 100% of users' screen.
Getting help
If you are using Angular oor React-scripts 5, you could find some problems. Take a look in some quick solutions at the troubleshooting articles.
Are you missing something or still need help? Please, please get in touch with the support team at help center.
Next steps
- Learn how to capture selfies with the SDK.
- Learn how to capture image of documents with the SDK.
- Learn more about the SDK in the Reference documentation.
- Check the REST APIs documentation.