# @onhand-bi/sdk

> OnhandBI SDK

Latest version **0.1.17** (published 2026-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @onhand-bi/sdk
pnpm add @onhand-bi/sdk
yarn add @onhand-bi/sdk
bun add @onhand-bi/sdk
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.17 |
| Published | 2026-06-27 |
| First published | 2023-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 419.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | OHBI |
| Maintainers | onhandbi, minhledang |
| Keywords | OnHandBI, OHBI, SDK, OHBISDK |

## Links

- npm: https://www.npmjs.com/package/@onhand-bi/sdk
- npm.io page: https://npm.io/package/@onhand-bi/sdk

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.6.1

## Recent versions

- 0.1.17 (latest) — 2026-06-27
- 0.1.16 — 2026-06-07
- 0.1.15 — 2026-05-30
- 0.1.14 — 2026-01-18
- 0.1.13 — 2025-11-02
- 0.1.12 — 2024-11-03
- 0.1.11 — 2024-10-13
- 0.1.10 — 2024-09-19
- 0.1.9 — 2024-09-03
- 0.1.8 — 2024-08-30
- 0.1.7 — 2024-07-23
- 0.1.6 — 2024-07-22
- 0.1.5 — 2024-06-13
- 0.1.4 — 2024-05-01
- 0.1.3 — 2023-12-10
- … 3 more at https://npm.io/package/@onhand-bi/sdk/versions

## README

# SDK ONHANDBI

[![Downloads](https://img.shields.io/npm/dt/@onhand-bi-dev/sdk.svg?style=flat&color=success)](https://www.npmjs.com/package/@onhand-bi-dev/sdk)
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/@onhand-bi-dev/sdk)
[![Build Size](https://img.shields.io/bundlejs/size/@onhand-bi-dev/sdk)](https://pkg-size.dev/@onhand-bi-dev/sdk)
[![Version](https://img.shields.io/npm/v/@onhand-bi-dev/sdk?style=flat&color=success)](https://www.npmjs.com/package/@onhand-bi-dev/sdk)
<a href="https://pkg-size.dev/@onhand-bi-dev/sdk"><img src="https://pkg-size.dev/badge/install/103906" title="Install size for @onhand-bi-dev/sdk"></a>
<a href="https://pkg-size.dev/@onhand-bi-dev/sdk"><img src="https://pkg-size.dev/badge/bundle/24854" title="Bundle size for @onhand-bi-dev/sdk"></a>

## Installation

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

## Import

```js
import OHBI from "@onhand-bi/sdk";
```

## Examples

### Auth

```js
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:

```js

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:

```js
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:

```js
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:

```js
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:

```js
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:

```js
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)
  })
```

---
_Source: https://npm.io/package/@onhand-bi/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
