Instalasi
Tambahkan dependensi dan konfigurasikan manajer paket
Langkah 1 — Konfigurasikan Content Security Policy (CSP)
Web SDK menggunakan Web Workers untuk keamanan dan performa. Tambahkan konfigurasi berikut ke CSP Anda:
<meta
http-equiv="Content-Security-Policy"
content="
script-src 'self' 'unsafe-eval' *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app *.sentry.io;
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;
connect-src *.googleapis.com *.acesso.io *.unico.run *.unico.io *.unico.app *.sentry.io"
/>
peringatan
Jika aplikasi Anda memiliki CSP, konfigurasi ini wajib dilakukan untuk memastikan SDK berfungsi dengan benar.
Langkah 2 — Instal paket
Web SDK tersedia melalui paket npm atau CDN.
- npm
- yarn
- CDN
npm install unico-webframe
yarn add unico-webframe
Unduh SDK dan impor ke proyek Anda:
Langkah 3 — Impor SDK
Setelah menginstal, impor SDK ke dalam proyek Anda.
- Dari npm
- Dari CDN
import {
UnicoCheckBuilder,
SelfieCameraTypes,
UnicoThemeBuilder,
DocumentCameraTypes,
UnicoConfig,
LocaleTypes
} from 'unico-webframe'
import {
UnicoCheckBuilder,
SelfieCameraTypes,
UnicoThemeBuilder,
DocumentCameraTypes,
UnicoConfig,
LocaleTypes
} from 'UnicoCheckBuilder.min.js'
Langkah 4 — Unduh file resource tambahan
File resource tambahan diperlukan untuk melakukan pengambilan gambar Liveness. Unduh file yang sesuai dengan versi SDK Anda dan sertakan dalam proyek Anda:
| Versi SDK | Resource FaceTec |
|---|---|
| 3.23.7 | 9.7.114 |
| 3.23.3 → 3.23.6 | 9.7.107 |
| 3.23.0 → 3.23.1 | 9.7.102 |
| 3.22.6 → 3.22.7 | 9.7.100 |
| 3.22.5 | 9.7.99 |
| 3.22.3 → 3.22.4 | 9.7.98 |
| 3.22.2 | 9.7.96 |
| 3.22.1 | 9.7.93 |
| 3.22.0 | 9.7.90 |
| 3.21.3 → 3.21.4 | 9.7.85 |
| 3.21.2 | 9.7.82 |
| 3.21.1 | 9.7.80 |
| 3.20.10 → 3.21.0 | 9.7.76 |
| 3.20.9 | 9.7.75 |
| 3.20.8 | 9.7.73 |
| 3.20.7 | 9.7.68 |
| 3.20.5 → 3.20.6 | 9.7.65 |
| 3.20.3 → 3.20.4 | 9.7.64 |
| 3.20.2 | 9.7.63 |
| 3.20.1 | 9.7.61 |
| 3.20.0 | 9.7.55 |
| 3.19.0 → 3.19.3 | 9.7.45 → 9.7.51 |
| 3.18.x | 9.6.92 → 9.7.41 (lihat tabel legacy) |
Unduh juga file AI untuk SDK: models.zip.
Public path
Semua file tambahan harus dihosting di lokasi publik yang dapat diakses oleh Web dalam proyek Anda.