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

@wanasapps/zoho-auth

v1.3.1

Published

Zoho OAuth, token refresh and session storage — one shared implementation for CLIs, editor extensions and services. Datacenter-aware, atomic 0600 session writes, grants shared across services.

Downloads

1,355

Readme

@wanasapps/zoho-auth

Zoho OAuth, token lifecycle and session storage — one implementation shared by every tool that talks to Zoho.

Built so a CLI, an editor extension and a background service can sign in once and see the same tokens, rather than each keeping its own copy and drifting.

npm install @wanasapps/zoho-auth

What it handles

Grants shared across services. Zoho caps a refresh token at 10 live access tokens. Storing one grant and pointing many services at it means a refresh updates all of them at once, instead of 44 services each racing to refresh and tripping the accounts rate limiter.

Project-local sessions, found the way git finds .git. zoneHome() walks up from the working directory looking for a .zone folder, falling back to ~/.zone, with ZONE_HOME overriding both. That lets one machine hold a different Zoho identity per project directory — a real need when you work across client orgs.

Safe writes. Session files are written to a random temp name in the same directory and renamed into place, so a concurrent reader never sees a half-written file, and they are chmod'd 0600.

Datacenter resolution. com, eu, in, com.au, jp, uk, ca, sa, ae, cn — including the odd ones, where Canada authenticates at accounts.zohocloud.ca but calls www.zohoapis.ca.

Usage

const auth = require('@wanasapps/zoho-auth');

const { token, session } = await auth.getAccessTokenWithSession('crm');
auth.setContext('books', { organization_id: '123456' });
auth.dc.zohoapisDomain('eu');   // https://www.zohoapis.eu

Wording the sign-in error

This package deliberately knows nothing about which Zoho products exist, or what your CLI is called. Inject that:

auth.setSignInHint((service) => `Run "zone login ${service}"`);

Without it you get a generic Sign in to <service> first.

Errors

Failures throw an AuthError carrying a code and an actionable hint. Map on code, never on the class — that is what lets one error work inside a CLI's exit-code table, an extension's notification and a server's response.

Codes: NOT_AUTHENTICATED, AUTH_FAILED, AUTH_TIMEOUT, BAD_INPUT.

Scope

This package does not know which Zoho services exist — see @wanasapps/zoho-api for the service registry and REST client built on top of it.

License

MIT © Wanas Apps FZ-LLC