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

zapi-inventory

v0.12.2

Published

TypeScript SDK for Zoho Inventory.

Downloads

464

Readme

zapi-inventory

A community-maintained, robust, and type-safe Typescript SDK that allows you to interact with the Zoho Inventory API.

Installation

bun add zapi-inventory

API

This module exports a class constructor which takes a configuration object.

ZohoInventory(config)

Creates a new ZohoInventory instance.

Arguments

  • config - Required - A plain JavaScript object that contains the configuration options.

    Options

    • client - Required - An object containing the Client ID and Client Secret obtained from the Zoho Developer Console.
      • id - A string specifying the Client ID.
      • secret - A string specifying the Client Secret.
    • orgId - Required - A string that specifies the Zoho Inventory Organization ID. This determines which organization's data the SDK will access.
    • refreshToken - Required - A string representing the permanent OAuth 2.0 refresh token. The SDK uses this to automatically generate and manage short-lived access tokens.
    • dc - Optional - A string specifying the data centre for the API domain. Supported values: com, eu, in, com.au, jp, ca, com.cn, sa. Defaults to com.
    • timeout - Optional - The number of milliseconds before a request times out. If the request takes longer than timeout, it will be aborted. Defaults to 10000 (10 seconds).
    • store - Optional - A custom token store implementation. The SDK uses FileTokenStore by default, which persists tokens to the file system. You can provide your own TokenStore implementation for alternative storage strategies.

Exceptions

Throws an Error or SDKExecepion exception if the required options are missing or an http error occurs.

Resources

Every resource or zoho inventory module is accessed via your inventory instance:

const inventory = new ZohoInventory({
  client: { id: Bun.env.ZOHO_CLIENT_ID, secret: Bun.env.ZOHO_CLIENT_SECRET },
  orgId: Bun.env.ZOHO_ORGANIZATION_ID,
  refreshToken: Bun.env.ZOHO_REFRESH_TOKEN,
  dc: 'eu',
});

// inventory.<module>.<method_name>

When using zapi-inventory, you do not have to specify the root key (e.g., item, salesorder, or contact) as the module automatically wraps the provided data. Using the item creation example, this translates to:

inventory.items
  .create({ name: 'Solar Panel', rate: 120, item_type: 'inventory' })
  .then((item) => console.log(item))
  .catch((err) => console.error(err));

The SDK exposes an http client on the SDK instance for making raw HTTP requests (GET, POST, PUT, DELETE) directly to the Zoho Inventory API. This is useful for accessing beta endpoints or retrieving specific sub-resources by crafting custom requests when the SDK does not yet provide a wrapper.

inventory.http.post<T>(options: {
  path: string[];    // Array of path segments
  body?: unknown; // Request payload
  query?: Record<string, string | number | boolean>; // Query parameters
  headers?: Record<string, string>; // Custom headers
  timeout?: number; // Request-specific timeout
})

Contributing

Contributions Welcome! You can contribute in the following ways.

  • Create an Issue - Propose a new feature. Report a bug.
  • Pull Request - Fix a bug or typo. Refactor the code.
  • Share - Share your thoughts on the Blog, X, and others.
  • Make your application - Please try to use the sdk.

For more details, see docs/CONTRIBUTING.md.

Contributors

Thanks to all contributors!

Authors

Ralph Mataga https://github.com/matagaralph

License

Distributed under the MIT License. See LICENSE for more information.