This demo is a self-contained NodeJS server and minimal frontend which covers:
- Running a server with a
BASE_URL
,API_KEY
,API_SECRET
that you can obtain from https://portal.iproov.com andNPM_ACCESS_TOKEN
that you can create once your get access to our private NPM registry (please contact [email protected]). - Creating tokens for Genuine Presence and Liveness transactions;
- Enrolling and verifying;
- Customising iProov Web with web component slots and CustomEvents.
For a basic example, all you need to run it is Docker and some minimal configuration:
- Obtain your environment variables and create a
.env
file - see.env.example
for a template. - From this
demo
directory, bring up the container with:bash run.sh
- Navigate to http://localhost:8080 in any desktop or mobile web browser.
For a deeper dive, you can of course run the server locally using NodeJS 14+:
export $(cat .env | xargs) && node src/server.js
- Frontend customisation:
- You can customise
createSDK
insidestatic/js/vendor/iproov-integration.js
- Available events
- Slot customisation
- Language customisation
- You can customise
- Backend customisation:
- You can customise
PlatformAPI
insidesrc/platform.js
- The server side is written in JavaScript and uses Hapi.js
- iProov Platform API v2 docs
- You can customise
- Validate endpoint: you can extend the example to implement the validate call
- Note that in production, it's important that this is implemented on the server side otherwise your API credentials will be exposed!
To access the device camera and other browser APIs, a "secure context" is required.
In practice this means running the server under TLS, or simply using localhost.
For this demo, we keep things simple with localhost. But to test on another device on your network like a mobile, TLS is required.