diff --git a/.changeset/config.json b/.changeset/config.json index fef6dd0..7a67203 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -4,10 +4,25 @@ "commit": false, "fixed": [ [ - "@microblink/blinkid*" + "@microblink/blinkid", + "@microblink/blinkid-core", + "@microblink/blinkid-ux-manager", + "@microblink/blinkid-wasm", + "@microblink/blinkid-worker" ], [ - "@microblink/blinkcard*" + "@microblink/blinkid-verify", + "@microblink/blinkid-verify-core", + "@microblink/blinkid-verify-ux-manager", + "@microblink/blinkid-verify-wasm", + "@microblink/blinkid-verify-worker" + ], + [ + "@microblink/blinkcard", + "@microblink/blinkcard-core", + "@microblink/blinkcard-ux-manager", + "@microblink/blinkcard-wasm", + "@microblink/blinkcard-worker" ] ], "access": "public", @@ -16,6 +31,7 @@ "ignore": [ "@microblink/*-example", "@microblink/*-qa-app", - "@microblink/*-test" -] + "@microblink/*-test", + "github-release" + ] } diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8e59b16..1753441 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -34,8 +34,8 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '24' - registry-url: 'https://registry.npmjs.org/' + node-version: "24" + registry-url: "https://registry.npmjs.org/" - name: Setup pnpm uses: pnpm/action-setup@v4 @@ -84,6 +84,13 @@ jobs: "@microblink/blinkcard" ) ;; + "@microblink/blinkid-verify") + PACKAGES=( + "@microblink/blinkid-verify-core" + "@microblink/blinkid-verify-ux-manager" + "@microblink/blinkid-verify" + ) + ;; *) echo "skip_publish=true" >> "$GITHUB_OUTPUT" echo "skip_reason=Release name does not contain a supported package name before the last @." >> "$GITHUB_OUTPUT" diff --git a/README.md b/README.md index 272e5f7..349bb48 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Have questions, feedback, or running into issues? We're here to help! Contact us | [@microblink/blinkid](https://github.com/microblink/web-sdks/tree/main/packages/blinkid) | [](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) | [](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) | [](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) | [](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) | [](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) | [](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) | | [@microblink/blinkcard](https://github.com/microblink/web-sdks/tree/main/packages/blinkcard) | [](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) | [](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) | [](https://www.npmjs.com/package/@microblink/blinkcard-ux-manager) | [CHANGELOG](https://github.com/microblink/web-sdks/blob/main/packages/blinkcard-ux-manager/CHANGELOG.md) | diff --git a/apps/examples/README.md b/apps/examples/README.md index dc22e18..794f953 100644 --- a/apps/examples/README.md +++ b/apps/examples/README.md @@ -1,6 +1,6 @@ -# BlinkID and BlinkCard Example Applications +# BlinkID, BlinkCard, and BlinkID Verify Example Applications -This directory contains example applications demonstrating the capabilities of the BlinkID and BlinkCard SDKs. +This directory contains example applications demonstrating the capabilities of the BlinkID, BlinkCard, and BlinkID Verify SDKs. ## Available Examples @@ -23,6 +23,11 @@ This directory contains example applications demonstrating the capabilities of t - [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. +### BlinkID Verify + +- [BlinkID Verify Simple](./blinkid-verify-simple/): A simple example of how to use the BlinkID Verify SDK. +- [BlinkID Verify Advanced Setup](./blinkid-verify-advanced-setup/): Demonstrates advanced setup and customization of the BlinkID Verify SDK. + ## Getting Started To run any of the example applications, follow these steps: @@ -45,11 +50,11 @@ pnpm build:packages ### 3. Set up the License Key -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). +BlinkID, BlinkCard, and BlinkID Verify 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: -``` +```env VITE_LICENCE_KEY=your-license-key ``` diff --git a/apps/examples/blinkid-verify-advanced-setup/.env.example b/apps/examples/blinkid-verify-advanced-setup/.env.example new file mode 100644 index 0000000..b3facb7 --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/.env.example @@ -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 commited + +# https://vitejs.dev/guide/env-and-mode.html#env-files + + +VITE_LICENCE_KEY=PLACE_YOUR_LICENCE_KEY_HERE diff --git a/apps/examples/blinkid-verify-advanced-setup/.eslintrc.cjs b/apps/examples/blinkid-verify-advanced-setup/.eslintrc.cjs new file mode 100644 index 0000000..4b6a985 --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/.eslintrc.cjs @@ -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, + }, + }, + ], +}); diff --git a/apps/examples/blinkid-verify-advanced-setup/.gitignore b/apps/examples/blinkid-verify-advanced-setup/.gitignore new file mode 100644 index 0000000..dd89a0e --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/.gitignore @@ -0,0 +1,7 @@ +node_modules +dist +public +types +certs +*.local +.env.production \ No newline at end of file diff --git a/apps/examples/blinkid-verify-advanced-setup/README.md b/apps/examples/blinkid-verify-advanced-setup/README.md new file mode 100644 index 0000000..c1bc175 --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/README.md @@ -0,0 +1,33 @@ +# BlinkID Verify Advanced Setup Example + +This example application demonstrates an advanced setup of the BlinkID Verify SDK, showcasing the integration of various components such as `@microblink/blinkid-verify-core`, `@microblink/blinkid-verify-ux-manager`, and `@microblink/camera-manager`. + +## Functionality + +The application performs the following actions: + +1. **Initializes the BlinkID Verify Core**: It starts by loading the WebAssembly (WASM) module and initializing the scanning engine with a license key. + +2. **Creates a Scanning Session**: A new scanning session is created with specific settings. + +3. **Manages the Camera**: It utilizes the `CameraManager` to handle the camera stream. + +4. **Manages the User Experience**: The `BlinkIdVerifyUxManager` is used to orchestrate the user experience, managing the interaction between the camera and the scanning session. + +5. **Renders the UI**: The application creates and mounts the camera and feedback UI components to the DOM, rendered as a portal outside the root element. It provides an option to show or hide an onboarding guide for the user. + +6. **Handles Results**: Upon successful scanning, the application displays the captured front, back, and barcode frame images. It also includes an optional debug overlay that shows live feedback stabilizer scores as a bar chart, the current UX state key, and the processing status. + +7. **Cleanup**: When the UI is dismounted, the application terminates the BlinkID Verify Core instance to free up resources. + +## Key Features Demonstrated + +- **Modular Integration**: Shows how to import and use different modules of the BlinkID Verify SDK (`blinkid-verify-core`, `blinkid-verify-ux-manager`, `camera-manager`) independently. +- **Manual Control**: Demonstrates how to manually control the initialization, scanning process, and UI components. +- **Custom UI**: Provides an example of how to integrate the SDK's UI components into a custom application layout. +- **Event Handling**: Shows how to subscribe to events from the `CameraManager` and `BlinkIdVerifyUxManager` to create a responsive user experience. +- **Result Handling**: Illustrates how to receive and display scanning results, including captured document frame images. + +## How to Run + +For detailed instructions on how to install dependencies and run this example, please refer to the [main README file](./../README.md). diff --git a/apps/examples/blinkid-verify-advanced-setup/index.html b/apps/examples/blinkid-verify-advanced-setup/index.html new file mode 100644 index 0000000..b0c53a1 --- /dev/null +++ b/apps/examples/blinkid-verify-advanced-setup/index.html @@ -0,0 +1,20 @@ + + +
+ + + + + +