Skip to content

JavaScript Core SDK

Version

The Core SDK provides essential communication and integration functions, without any user interface.

Installation

We use Cloudsmith as our private package registry.

@biometrid/standard-web-sdk

NPM

npm install \
  --registry=https://npm.cloudsmith.io/biometrid/web-uat/ \
  '@biometrid/standard-web-sdk@3.X.X'

HTML Script Tag

<!-- Add all SDK files to the same folder -->
<script src="./sdk/index.js"></script>

Getting Started

import "@biometrid/standard-web-sdk";

const biometrid = await BiometridStandard.initialize({
  url: "https://api.uat.biometrid.com", // required
  credential: "your-credential-uuid", // required
  app: "your-application-uuid",
  language: "pt",
  sentry: "",
  device: "desktop", // desktop || mobile
  customHeaders: {},
  socketEventCallback: (type, data) => console.log(type, data),
});

Available Methods (after initialization)

General

  • getVersion()
  • getAccount()
  • getProviders()
  • getSystem()
  • getCustomization()
  • setCustomHeaders(headers)
  • setLanguage(code)

Document & Face Capture & Liveness

startAutoCapture(options) / stopAutoCapture()

See AutoCapture for the full options reference.

startLiveness(options)

See Liveness for the full options reference.

Device & Browser

  • browser.askCameraPermission()
  • browser.askMicrophonePermission()
  • browser.getDetails()
  • browser.checkMinimumRequirements()
  • camera.start(), camera.takePhoto(), camera.stop()

Flow & Process

  • getFlow()
  • createProcess()
  • getCurrentStep(processId)
  • updateStep(processId, data) — the accepted payloads for the data parameter are described in Update Step
  • previousStep(processId)

Files & Utilities

  • getFile(url)
  • compressImage(base64)
  • validFileSize(base64)
  • docType.IDCARD, docType.PASSPORT

Feature Documentation

  • Autocapture — Automatic document and face capture
  • Liveness — Face01 and Face06 liveness detection