Skip to content
Open
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
  •  
  •  
  •  
17 changes: 10 additions & 7 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
"commit": false,
"fixed": [
[
"@microblink/blinkid",
"@microblink/blinkid-core",
"@microblink/blinkid-ux-manager",
"@microblink/blinkid-wasm",
"@microblink/blinkid-worker"
"@microblink/blinkid*"
],
[
"@microblink/blinkcard*"
]
],
"access": "restricted",
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
"ignore": [
"@microblink/*-example",
"@microblink/*-qa-app",
"@microblink/*-test"
]
}
13 changes: 0 additions & 13 deletions .npmrc

This file was deleted.

15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# BlinkID Web
# Microblink Web SDKs

## Getting Started

Please follow the documentation at [blinkid.docs.microblink.com](https://blinkid.docs.microblink.com/sdk/web/)!
Please follow the documentation at [docs.microblink.com](https://docs.microblink.com)!

## Questions & Issues

Expand All @@ -12,7 +12,10 @@ Have questions, feedback, or running into issues? We're here to help! Contact us

| Package | Version | Changelog |
|---------|---------|-----------|
| [@microblink/blinkid](https://github.com/BlinkID/blinkid-web/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/BlinkID/blinkid-web/blob/main/packages/blinkid/CHANGELOG.md) |
| [@microblink/blinkid-core](https://github.com/BlinkID/blinkid-web/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/BlinkID/blinkid-web/blob/main/packages/blinkid-core/CHANGELOG.md) |
| [@microblink/blinkid-ux-manager](https://github.com/BlinkID/blinkid-web/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/BlinkID/blinkid-web/blob/main/packages/blinkid-ux-manager/CHANGELOG.md) |
| [@microblink/camera-manager](https://github.com/BlinkID/blinkid-web/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/BlinkID/blinkid-web/blob/main/packages/camera-manager/CHANGELOG.md) |
| [@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/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) |
| [@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) |
16 changes: 13 additions & 3 deletions apps/examples/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# BlinkID SDK Example Applications
# BlinkID and BlinkCard Example Applications

This directory contains example applications demonstrating the capabilities of the BlinkID SDK.
This directory contains example applications demonstrating the capabilities of the BlinkID and BlinkCard SDKs.

## Available Examples

### BlinkID

- [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 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.
- [BlinkID Preload](./blinkid-preload/): Demonstrates how to preload the BlinkID SDK for faster initialization.

### BlinkCard

- [BlinkCard Simple](./blinkcard-simple/): A simple example of how to use the BlinkCard SDK.
- [BlinkCard Advanced Setup](./blinkcard-advanced-setup/): Demonstrates advanced setup and customization of the BlinkCard SDK.

### Camera

- [Camera Manager](./camera-manager/): An example of how to use the camera manager.
- [Camera Selection](./camera-selection/): An example of how to use the camera selection feature.

Expand All @@ -35,7 +45,7 @@ pnpm build:packages

### 3. Set up the License Key

Most of the example applications require a license key to run. You can obtain a free trial license key by registering on the [Microblink Developer Hub](https://developer.microblink.com/license/new).
BlinkID and BlinkCard example applications require a license key to run. You can obtain a free trial license key by registering on the [Microblink Developer Hub](https://developer.microblink.com/license/new).

After obtaining the license key, create a `.env.local` file in the root of the specific example application you want to run (e.g., `apps/examples/blinkid-simple/.env.local`) and add the following line:

Expand Down
53 changes: 53 additions & 0 deletions apps/examples/blinkcard-advanced-setup/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const { defineConfig } = require("eslint-define-config");

module.exports = defineConfig({
root: true,

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

overrides: [
{
files: ["src/**/*.{ts,tsx}"],
plugins: ["@typescript-eslint", "solid"],
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:solid/typescript",
"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,
},
},
],
});
6 changes: 6 additions & 0 deletions apps/examples/blinkcard-advanced-setup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
public
types
*.local
.env.production
28 changes: 28 additions & 0 deletions apps/examples/blinkcard-advanced-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# BlinkCard Advanced Example

This example application demonstrates an advanced setup of the BlinkCard SDK, showcasing the integration of modular packages such as `@microblink/blinkcard-core`, `@microblink/blinkcard-ux-manager`, and `@microblink/camera-manager`.

## Functionality

The application performs the following actions:

1. **Initializes BlinkCard Core**: It loads the WebAssembly (WASM) resources and initializes the scanning engine using a license key.
2. **Creates a Scanning Session**: It starts a new scanning session with explicit scanning settings.
3. **Manages Camera Access**: It creates and controls a `CameraManager` instance for camera stream and frame capture.
4. **Manages UX Flow**: It creates a BlinkCard UX manager to orchestrate scanning behavior and callbacks.
5. **Renders Camera + Feedback UI**: It mounts camera UI and feedback UI, and demonstrates onboarding control.
6. **Handles Results**: It listens for result callbacks and displays a sanitized JSON result in the page.
7. **Shows Debug Overlay**: It includes a debug `DebugOverlay` component for frame-level state, scores, and card outline visualization.
8. **Cleans Up Resources**: It terminates core resources when UI is dismounted.

## Key Features Demonstrated

- **Modular Integration**: Uses low-level BlinkCard packages directly instead of the high-level `@microblink/blinkcard` wrapper.
- **Manual Lifecycle Control**: Explicit initialization, playback synchronization, frame capture start, and teardown.
- **Custom UI Placement**: Optional portal mode for rendering SDK UI outside of the root node.
- **Debug Instrumentation**: Visualizes feedback stabilizer scores and process state for development/debugging.
- **Result Post-Processing**: Removes image payloads before rendering result JSON for readability.

## How to Run

For detailed instructions on how to install dependencies and run this example, refer to the [main README file](./../README.md).
19 changes: 19 additions & 0 deletions apps/examples/blinkcard-advanced-setup/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!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" />
<meta
http-equiv="Content-Security-Policy"
content="worker-src 'self' blob:"
/>
<title>BlinkCard Advanced Example</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>

<script src="/src/index.tsx" type="module"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions apps/examples/blinkcard-advanced-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"],
};
45 changes: 45 additions & 0 deletions apps/examples/blinkcard-advanced-setup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "@microblink/blinkcard-advanced-setup-example",
"description": "An example of advanced BlinkCard SDK setup",
"private": true,
"scripts": {
"build": "vite build",
"build:js-dev": "vite build --mode development",
"clean": "rimraf dist public .turbo types tsconfig.tsbuildinfo",
"dev": "vite --host",
"lint": "concurrently pnpm:lint:types pnpm:lint:eslint",
"lint:eslint": "eslint ./src --max-warnings 0",
"lint:types": "tsc --emitDeclarationOnly false --noEmit",
"preview": "vite preview",
"watch": "vite build --watch --mode development"
},
"type": "module",
"dependencies": {
"@microblink/blinkcard-core": "workspace:^",
"@microblink/blinkcard-ux-manager": "workspace:^",
"@microblink/camera-manager": "workspace:^",
"@microblink/feedback-stabilizer": "workspace:^",
"solid-js": "^1.9.9",
"yy-fps": "^2.0.1"
},
"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.0.1",
"eslint-define-config": "^1.24.1",
"eslint-plugin-solid": "0.14.5",
"prettier": "^3.6.2",
"rimraf": "^6.0.1",
"tsc-files": "^1.1.4",
"typescript": "5.8.3",
"vite": "^6.2.1",
"vite-plugin-mkcert": "^1.17.6",
"vite-plugin-qrcode": "^0.2.4",
"vite-plugin-solid": "^2.11.6",
"zx": "^8.8.5"
},
"license": "MIT"
}
Loading
Loading