Skip to content

Incode-Technologies-Example-Repos/onboarding-core-javascript

Repository files navigation

Onboarding Core Vanilla Javascript Example

This examples runs the basic create session in backend -> frontId -> backID -> processId -> Selfie -> finish status in backend flow, the code is simple enough to insert or remove any step for testing or creating proof of concepts.

Requirements

Vite requires Node.js version 14.18+, 16+. some templates require a higher Node.js version to work, please upgrade if your package manager warns about it.

Install

Run npm install

Config

Copy .env.example to .env.local and add your local values

VITE_API_URL=https://demo-api.incodesmile.com/0
VITE_SDK_URL=https://sdk.incode.com/sdk/onBoarding-1.80.1.js
VITE_CONSENT_ID=

# HERE ONLY FOR DEMO PURPOSES, THE APIKEY AND THE FLOW_ID SHOULD NEVER BE IN THE FRONTEND.
VITE_FAKE_BACKEND_APIURL=https://demo-api.incodesmile.com
VITE_FAKE_BACKEND_APIKEY=
VITE_FAKE_BACKEND_FLOW_ID=

Remember the Flow holds the backend counter part of the process, some configurations there might affect the behavior of the WebSDK here.

Fake Backend Server

Starting and Finishing the session must be done in the backend, to simplify development this sample includes a fake_backend.js file that does this in the frontend, please be advised to replace this with a proper backend for your production runs. the APIKEY should never be exposed in the frontend.

Run

Vite is configured to serve the project using https and and expose him self, so you can easily test with your mobile phone on the local network.

run npm run dev

A new server will be exposed, the data will be in the terminal

Build

run npm run build

A new build will be created in /dist you can serve that build everywhere just remember to serve with https.

Testing especific versions of the webSDK locally

You can save the specific version needed under /public and change the VITE_SDK_URL variable on .env.local to something like:

VITE_SDK_URL=/name-of-the-js-file.js

About

Onboarding Example in Vanilla Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •