Do you have samples for the Web SDK and how can I run them?

Yes, we do. If you want to immediately try out the performance of our barcode scanner, please try out our demo app. If you want to see how our JavaScript library can be integrated, our samples highlight simple usage of our JavaScript API to provide barcode scanning in the browser.

1. To use our samples shipped with the SDK, you first need to install our SDK and http-server npm package (with npm or yarn commands).

  • With npm commands:
    // navigate to the project's directory
    > cd path/to/directory
    // initialize the npm project
    > npm init
    // download the web sdk
    > npm install scandit-sdk --save
    // install globally the http-server package

    > npm install http-server -g
  • With yarn commands:
    // navigate to the project's directory
    > cd path/to/directory
    // download the web sdk
    > yarn add scandit-sdk
    // install globally the http-server package

    > yarn global add http-server


2. In your project's directory now appeared a few files. Go to node_modules > scandit-sdk and add your license key (you will find it on inside the samples (example.html and example_background.html). The code snippet you need to insert the key into is: 

  engineLocation: "build"

3. Next, you can simply go to the samples directory and run the installed package:

// go to the samples directory
> cd node_modules/scandit-sdk
// run the new package

4. You can now open your browser and access the samples on the following URLs:

5. For more samples, using not only JavaScript but also React and Angular technology, please check out our Github repository for samples for the Web SDK:

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request