npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

onprint-sdk-light

v0.6.0

Published

Onprint Simple SDK to wrap API

Readme

Onprint Javascript SDK Light

This SDK is the easiest way to explore LTU Tech image recognition tools by wraping ONprint API endpoint and provides simple methods to access it

Instalation

npm install onprint-sdk-light

Usage

There is two ways to use this SDK:

SDK Class Object

This object contains all the methods to request an Enriched Image, Pictures (by Id or File) and send clickstream action to feed the reporting

Initialize SDK

To initialize the SDK you need to provide informations used by our reporting service:

  • Device Header
  • Application Header
  • Api Key
import {SdkLight} from 'onprint-sdk-light';

const applicationHeader = {
    name: 'Your Application App Name',
    version: '1.0.0',
    id: 'Random Id' // Unique for each user
};

const deviceHeader = {
    name: 'A Device Name',
    version: '8.0.0',
    versionName: 'Oreo'
};

const sdk = new SdkLight(YOUR_API_KEY, applicationHeader, deviceHeader);

By default the lang is set to 'fr-FR' but you can change it with:

sdk.setLang('en-EN')

more precision with the Lang features here: ONprint API

Scan Enriched Image

The ONprint API provides you 2 ways to request Enriched Images

  • With Image Id

    try {
        const enrichedImage = await sdk.getEnrichedImageById('b9ceb71c-aad9-4c90-80c6-4fe894de85fb');
    } catch (err) {
        console.log(err);
    }
  • With Image File

    try {
        const imgBuffer = fs.readFileSync('image.jpeg');
        const enrichedImage = await sdk.getEnrichedImageByImage(imageBuffer);
    } catch (err) {
        console.log(err);
    }

Scan Picture

The ONprint API provides you 2 ways to request Pictures

  • With Image Id

    try {
        const picture = await sdk.getPictureByImage('b9ceb71c-aad9-4c90-80c6-4fe894de85fb');
    } catch (err) {
        console.log(err);
    }
  • With Image File

    try {
        const imgBuffer = fs.readFileSync('picture.jpeg');
        const pictures = await sdk.getPictureByImage(imageBuffer);
    } catch (err) {
        console.log(err);
    }

As you can see, the SDK methodes return Promise, if an error occure the SDK will throw an Error to catch.

Click on Action

This features is really important to get feedback of your user and have data on which content is most used. To work the Click methode need to get 2 arguments: - ActionId find in the EnrichedImages responses Actions attribute - SessionId Automaticly set to the last valid Enriched Image request

The methode return true in case of success

try {
    const enrichedImage = await sdk.getEnrichedImageById('b9ceb71c-aad9-4c90-80c6-4fe894de85fb');
    sdk.clickOnAction(enrichedImage.Actions[0].Id);
} catch (err) {
    console.log(err);
}

API Functions

If you prefer not use the SDK Class we provide you, it's possible to use directly the Onprint API call and have more controle with the functions return and behavior.

Enriched Image

Picture

Click Stream

Test

To run test simply launch the command with your API KEY

API_KEY=your_api_key npm run test

Support

You can contact me for any issue at [email protected]

License

© LTU Tech 2018 All Rights Reserved