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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@onhand-bi-dev/sdk

v0.1.12

Published

OnhandBI SDK

Downloads

14

Readme

SDK ONHANDBI

Downloads Libraries.io dependency status for latest release Build Size Version

Installation

npm i @onhand-bi-dev/sdk
# or
# yarn add @onhand-bi-dev/sdk

Import

import OHBI from "@onhand-bi-dev/sdk";

Examples

Auth

const accessToken = "<your access token>"
const OHBI_SDK = await OHBI.newClient(accessToken);

Get List Report

This method retrieves a list of reports.

Parameters:

page (number, optional): The page number of the report list. Default is 1. searchText (string, optional): The search text to filter reports. Default is an empty string. Returns:

A Promise that resolves to an array of Report objects representing the reports.

Example:


OHBI_SDK.getReports(1, 'search text')
  .then((reports) => {
    // Process the list of reports
    console.log('Reports:', reports)
  })
  .catch((error) => {
    console.log('Error retrieving reports:', error)
  })

Get Report

This method retrieves a specific report by its ID.

Parameters:

reportId (number): The ID of the report. isOwner (boolean, optional): Indicates whether the client is the owner of the report. Default is false. Returns:

A Promise that resolves to a Report object representing the report, or null if the report is not found.

Example:

const reportId = 12345

OHBI_SDK.getReport(reportId)
  .then((report) => {
    if (report) {
      // Process the report
      console.log('Report:', report)
    } else {
      console.log('Report not found')
    }
  })
  .catch((error) => {
    console.log('Error retrieving report:', error)
  })

Load Report

This method loads a report into an HTML element identified by the specified tag ID.

Parameters:

reportId (number): The ID of the report to load. tagId (string): The ID of the HTML element where the report should be loaded. isOwner (boolean, optional): Indicates whether the client is the owner of the report. Default is false. Example:

const reportId = 12345
const tagId = 'report-container'

OHBI_SDK.loadReport(reportId, tagId, true)

Load App

This method loads an app into an HTML element identified by the specified tag ID.

Parameters:

appId (number): The ID of the app to load. tagId (string): The ID of the HTML element where the app should be loaded. isOwner (boolean, optional): Indicates whether the client is the owner of the app. Default is false.

Example:

const appId = 54321
const tagId = 'app-container'

client.loadApp(appId, tagId, false)

Get App

This method retrieves a specific app by its ID.

Parameters:

appId (number): The ID of the app. isOwner (boolean, optional): Indicates whether the client is the owner of the app. Default is false.

Returns:

A Promise that resolves to an AppModel object representing the app, or null if the app is not found.

Example:

const appId = 54321

OHBI_SDK.getApp(appId)
  .then((app) => {
    if (app) {
      // Process the app
      console.log('App:', app)
    } else {
      console.log('App not found')
    }
  })
  .catch((error) => {
    console.log('Error retrieving app:', error)
  })

Get List App

This method retrieves a list of apps.

Parameters:

page (number, optional): The page number of the app list. Default is 1. searchText (string, optional): The search text to filter apps. Default is an empty string. isOwner (boolean, optional): Indicates whether the client is the owner of the app. Default is false.

Returns:

A Promise that resolves to an array of AppModel objects representing the apps.

Example:

OHBI_SDK.getApps(1, 'search text', false)
  .then((apps) => {
    // Process the list of apps
    console.log('Apps:', apps)
  })
  .catch((error) => {
    console.log('Error retrieving apps:', error)
  })