Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
]
],
"access": "public",
"baseBranch": "master",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"@microblink/*-example",
"@microblink/*-qa-app",
"@microblink/*-test",
"github-release"
"@microblink/public-repo-generator"
]
}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,conan,cmake,c++,node

.turbo

# junk files
vite.config.*.timestamp-*

Expand Down Expand Up @@ -300,8 +301,18 @@ Session.vim
# JetBrains IDEs
.idea

# Clion bazel plugin files
.clwb

#mise local
mise.local.toml

# npmrc
.npmrc

# Bazel files
/bazel-*
/external

automatic.bazelrc
.bazeltargets
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,32 @@ Have questions, feedback, or running into issues? We're here to help! Contact us

## Packages

### BlinkID

| Package | Version | Changelog |
|---------|---------|-----------|
| [@microblink/blinkid](https://github.com/microblink/web-sdks/tree/main/packages/blinkid) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid.svg)](https://www.npmjs.com/package/@microblink/blinkid) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid/CHANGELOG.md) |
| [@microblink/blinkid-core](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-core) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-core.svg)](https://www.npmjs.com/package/@microblink/blinkid-core) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-core/CHANGELOG.md) |
| [@microblink/blinkid-ux-manager](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-ux-manager) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-ux-manager.svg)](https://www.npmjs.com/package/@microblink/blinkid-ux-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-ux-manager/CHANGELOG.md) |
| [@microblink/blinkid-verify](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify/CHANGELOG.md) |
| [@microblink/blinkid-verify-core](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify-core) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify-core.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify-core) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify-core/CHANGELOG.md) |
| [@microblink/blinkid-verify-ux-manager](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify-ux-manager) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify-ux-manager.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify-ux-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify-ux-manager/CHANGELOG.md) |

### BlinkCard

| Package | Version | Changelog |
|---------|---------|-----------|
| [@microblink/blinkcard](https://github.com/microblink/web-sdks/tree/main/packages/blinkcard) | [![npm](https://img.shields.io/npm/v/@microblink/blinkcard.svg)](https://www.npmjs.com/package/@microblink/blinkcard) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkcard/CHANGELOG.md) |
| [@microblink/blinkcard-core](https://github.com/microblink/web-sdks/tree/main/packages/blinkcard-core) | [![npm](https://img.shields.io/npm/v/@microblink/blinkcard-core.svg)](https://www.npmjs.com/package/@microblink/blinkcard-core) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkcard-core/CHANGELOG.md) |
| [@microblink/blinkcard-ux-manager](https://github.com/microblink/web-sdks/tree/main/packages/blinkcard-ux-manager) | [![npm](https://img.shields.io/npm/v/@microblink/blinkcard-ux-manager.svg)](https://www.npmjs.com/package/@microblink/blinkcard-ux-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkcard-ux-manager/CHANGELOG.md) |

### BlinkID Verify

| Package | Version | Changelog |
|---------|---------|-----------|
| [@microblink/blinkid-verify](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify/CHANGELOG.md) |
| [@microblink/blinkid-verify-core](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify-core) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify-core.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify-core) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify-core/CHANGELOG.md) |
| [@microblink/blinkid-verify-ux-manager](https://github.com/microblink/web-sdks/tree/main/packages/blinkid-verify-ux-manager) | [![npm](https://img.shields.io/npm/v/@microblink/blinkid-verify-ux-manager.svg)](https://www.npmjs.com/package/@microblink/blinkid-verify-ux-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkid-verify-ux-manager/CHANGELOG.md) |

### Camera Manager

| Package | Version | Changelog |
|---------|---------|-----------|
| [@microblink/camera-manager](https://github.com/microblink/web-sdks/tree/main/packages/camera-manager) | [![npm](https://img.shields.io/npm/v/@microblink/camera-manager.svg)](https://www.npmjs.com/package/@microblink/camera-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/camera-manager/CHANGELOG.md) |
1 change: 1 addition & 0 deletions apps/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This directory contains example applications demonstrating the capabilities of t

- [BlinkID Simple](./blinkid-simple/): A simple example of how to use the BlinkID SDK.
- [BlinkID Advanced Setup](./blinkid-advanced-setup/): Demonstrates advanced setup and customization of the BlinkID SDK.
- [BlinkID OTA Setup](./blinkid-ota-setup/): Demonstrates how to configure over-the-air (OTA) document-support resource updates when initializing BlinkID.
- [BlinkID UI Customization](./blinkid-ui-customization/): Shows how to implement custom UI, such as replacing UI for various error states (camera errors, timeouts, unsupported documents, filtered documents).
- [BlinkID Photo Upload](./blinkid-photo-upload/): An example of how to use the BlinkID SDK with photo upload functionality.
- [BlinkID Core API](./blinkid-core-api/): Shows how to use the core API of the BlinkID SDK.
Expand Down
5 changes: 0 additions & 5 deletions apps/examples/blinkid-advanced-setup/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ export const App: Component = () => {
* @see https://github.com/microblink/web-sdks/blob/main/packages/blinkid-core/docs/type-aliases/BlinkIdSessionSettings.md
*/
const session = await blinkIdCore.createScanningSession({
/*
* For default settings look at defaultSessionSettings
*
* @see https://github.com/microblink/web-sdks/blob/main/packages/blinkid-core/src/defaultSessionSettings.ts
*/
scanningSettings: {
documentCaptureModule: {
passportDataPageScanOnly: false,
Expand Down
7 changes: 7 additions & 0 deletions apps/examples/blinkid-ota-setup/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# For development, create a .env.local or a .env.production using this template
# Never put your licence key in this file as it will be committed

# https://vitejs.dev/guide/env-and-mode.html#env-files


VITE_LICENCE_KEY=PLACE_YOUR_LICENCE_KEY_HERE
52 changes: 52 additions & 0 deletions apps/examples/blinkid-ota-setup/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const { defineConfig } = require("eslint-define-config");

module.exports = defineConfig({
root: true,

parserOptions: {
ecmaVersion: "2022",
sourceType: "module",
},

overrides: [
{
files: ["src/**/*.{ts,tsx}"],
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
// have to duplicate in override...
rules: {
"@typescript-eslint/no-unused-vars": 0,
// the following two are causing errors in vscode. See:
// https://typescript-eslint.io/linting/troubleshooting/#changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
// only use in tsx
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/consistent-type-definitions": 0,
"prefer-const": 0,
},
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"prettier",
],
},
{
files: ["**/*.{js,mjs,cjs}"],
env: {
node: true,
browser: true,
es2021: true,
},
extends: ["eslint:recommended"],
rules: {
"no-unused-vars": 0,
},
},
],
});
7 changes: 7 additions & 0 deletions apps/examples/blinkid-ota-setup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
dist
public
types
certs
*.local
.env.production
33 changes: 33 additions & 0 deletions apps/examples/blinkid-ota-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# BlinkID OTA Setup Example

This example application demonstrates how to configure over-the-air (OTA) document-support resource updates when initializing BlinkID with `createBlinkId`. OTA lets Microblink add or update supported document resources without requiring a new SDK release or application package update.

## Functionality

The application performs the following actions:

1. **Initializes BlinkID with OTA settings**: It calls `createBlinkId` with an `otaResources` configuration that controls how the SDK loads baseline OTA files and checks for newer resources from an OTA provider.

2. **Configures OTA behavior**: The example sets:
- `strict: true` — fail initialization if the OTA download fails (instead of falling back to the hosted baseline)
- `checkForUpdates: true` — always query the OTA provider for a newer compatible version
- `otaResourceProviderUrl: undefined` — use Microblink's default OTA service (`https://blinkid-ota.microblink.com`); set a URL to use a proxy or self-hosted provider
- `resourcesLocation: "custom-ota-resources"` — load the hosted/bundled OTA baseline from that path (see `public/custom-ota-resources` for the expected layout)
- `timeoutMilis: 5000` — OTA service request timeout in milliseconds

3. **Sets up a Result Callback**: It registers a callback that runs when a document is successfully scanned and logs the result to the console.

4. **Cleans up Resources**: After logging the result, it calls `destroy` to release SDK resources.

## Key Features Demonstrated

- **OTA resource bootstrap**: Shows how to pass `otaResources` to `createBlinkId` to customize document-support resource loading at init time.
- **Strict vs fallback behavior**: Demonstrates failing hard on OTA errors (`strict: true`) instead of silently using the hosted baseline.
- **Update checks**: Illustrates enabling provider checks with `checkForUpdates`, and notes that `checkForUpdates: false` skips the provider and uses only the hosted baseline.
- **Custom baseline location**: Points `resourcesLocation` at custom OTA baseline files instead of the default SDK path.
- **Provider / proxy override**: Leaves `otaResourceProviderUrl` unset for Microblink's service, with guidance for pointing it at a proxy or self-hosted endpoint that implements the versions API.
- **High-level API**: Still uses the simple `createBlinkId` flow for scanning, result handling, and cleanup.

## How to Run

For detailed instructions on how to install dependencies and run this example, please refer to the [main README file](./../README.md).
20 changes: 20 additions & 0 deletions apps/examples/blinkid-ota-setup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
<meta
http-equiv="Content-Security-Policy"
content="worker-src 'self' blob:"
/>
<title>BlinkID OTA Setup Example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.ts" type="module"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions apps/examples/blinkid-ota-setup/lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
"*.{js,jsx,ts,tsx}": [() => "eslint --max-warnings=0"],
"*.{ts,tsx}": [
() => "tsc-files --skipLibCheck --emitDeclarationOnly false --noEmit",
],
"*.{js,jsx,ts,tsx,css,md}": ["prettier --write"],
};
43 changes: 43 additions & 0 deletions apps/examples/blinkid-ota-setup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@microblink/blinkid-ota-setup",
"description": "Example quickstart app showcasing customization of OTA behaviour",
"private": true,
"scripts": {
"build": "vite build",
"build:js-dev": "vite build --mode development",
"clean": "rimraf dist public .turbo types tsconfig.tsbuildinfo",
"dev": "vite",
"lint": "concurrently pnpm:lint:types pnpm:lint:eslint",
"lint:eslint": "eslint ./src --max-warnings 0",
"lint:types": "tsc --emitDeclarationOnly false --noEmit",
"make-certs": "mkcert-cli -y --outDir certs",
"preview": "vite preview",
"serve": "pnpm make-certs && serve --ssl-cert ./certs/dev.cert --ssl-key ./certs/dev.key",
"watch": "vite build --watch --mode development"
},
"type": "module",
"dependencies": {
"@microblink/blinkid": "workspace:^"
},
"devDependencies": {
"@microblink/tsconfig": "workspace:*",
"@microblink/repo-utils": "workspace:*",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"concurrently": "^9.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "10.1.8",
"eslint-define-config": "^1.24.1",
"eslint-plugin-solid": "0.14.5",
"mkcert-cli": "^1.5.0",
"prettier": "^3.8.1",
"rimraf": "^6.0.1",
"sass": "^1.85.0",
"serve": "^14.2.4",
"tsc-files": "^1.1.4",
"typescript": "5.8.3",
"vite": "^6.2.1",
"vite-plugin-mkcert": "^1.17.9",
"zx": "^8.8.5"
},
"license": "MIT"
}
31 changes: 31 additions & 0 deletions apps/examples/blinkid-ota-setup/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"public": "dist",
"headers": [
{
"source": "**/*",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": "require-corp"
},
{
"key": "Cross-Origin-Opener-Policy",
"value": "same-origin"
}
]
},
{
"source": "resources/**/*",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=300"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
]
}
Binary file not shown.
39 changes: 39 additions & 0 deletions apps/examples/blinkid-ota-setup/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
*/

import { createBlinkId } from "@microblink/blinkid";

/**
* This is the main component of the application.
* It creates the BlinkID instance. For additional configuration look at the createBlinkId function.
*
* @see https://github.com/microblink/web-sdks/blob/main/packages/blinkid/docs/functions/createBlinkId.md
*/
const blinkid = await createBlinkId({
licenseKey: import.meta.env.VITE_LICENCE_KEY,
otaResources: {
// Setting strict to true will case the SDK to fail and throw an exception if the ota download fails, otherwise it will fallback to the bundled resources
strict: true,

// Setting checkForUpdates to true will cause the SDK to always ping the Ota service to see if there's a newer version, and if so download it
checkForUpdates: true,

// URL to the ota resource provider, leave blank to use Microblink's ota service, set to use a proxy or self hosted
// otaResourcesProviderUrl: <YOUR_OTA_PROVIDER_URL>,
otaResourceProviderUrl: undefined,

// URL to the "bundled" ota resources, look at the public/custom-ota-resources folder to see the required structure,
// these resources are always downloaded if checkForUpdates is false, or if checkForUpdates is true, we will check if these are already the latest
// version, and use them instead of downloading from the Ota resource provider.
// resourcesLocation: "custom-ota-resources",

// Ota service request timeout in milliseconds
timeoutMilis: 5000,
},
});

blinkid.addOnResultCallback((result) => {
console.log(result);
void blinkid.destroy();
});
13 changes: 13 additions & 0 deletions apps/examples/blinkid-ota-setup/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) 2026 Microblink Ltd. All rights reserved.
*/

/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_LICENCE_KEY: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
14 changes: 14 additions & 0 deletions apps/examples/blinkid-ota-setup/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// "extends": "@microblink/tsconfig/base.json",
"compilerOptions": {
"noEmit": true,
"module": "Preserve",
"strict": true,
"declarationMap": false,
"target": "es2022",
"rootDir": "src",
"jsx": "preserve",
"types": ["vite/client"]
},
"include": ["src"]
}
Loading
Loading