Skip to content

Latest commit

 

History

History

SearchAndFindSample

MatrixScan Simple sample

A very simple example of setting up the library to track barcodes.

Prerequisites

Before proceeding, you will need a valid Scandit DataCapture SDK license key. You can retrieve it by signing into your account at https://ssl.scandit.com.

Installation

Install dependencies:

npm install

How to run

Make sure SCANDIT_LICENSE_KEY is available in your environment, by either:

  • running SCANDIT_LICENSE_KEY=<YOUR_LICENSE_KEY> npm run build
  • placing your license key in a .env file at the root of the sample directory
  • or by inserting your license key into index.ts, replacing the placeholder -- ENTER YOUR SCANDIT LICENSE KEY HERE -- with the key.

Build and serve the application:

npm run build
npm run serve

Open http://localhost:8888 and start scanning.

How to test the sample from any device

You can use an SSH tunnel to access the running sample from another device via the internet. To do so, you can install ngrok and create a tunnel to the running sample:

# execute this after npm run serve
ngrok http 8888

Make sure you use the HTTPS tunnel because most of the browsers will deny permission to access the camera in non-secure contexts.

Development

Make sure SCANDIT_LICENSE_KEY is available in your environment, by either:

  • running SCANDIT_LICENSE_KEY=<YOUR_LICENSE_KEY> npm run dev
  • placing your license key in a .env file at the root of the sample directory
  • or by inserting your license key into index.ts, replacing the placeholder -- ENTER YOUR SCANDIT LICENSE KEY HERE -- with the key.

Start the development server:

npm run dev

Open http://localhost:8888 and start scanning.