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

@apowerb/apowerb-sdk

v0.1.39

Published

JavaScript SDK for the apowerb backend: agents, tools, RAG, BI, webhooks and billing. Dependency-free, runs in the browser and in Node.

Readme

@apowerb/apowerb-sdk

JavaScript client for the apowerb backend: agents, tools, RAG, BI, webhooks, billing, skills. 143 functions, no dependencies, no React and no Next code — usable in a browser as well as in Node.

Why this package

This layer used to live in src/lib/api.js inside the Next application, with const BASE = "" hard-coded: every request went out relative to /api/..., which assumes being served by the app that proxies those routes. The most reusable part of the repository was therefore trapped inside the front end.

Usage

With no configuration the behaviour is the original one — relative requests, token read from localStorage — so the Next application does not change by a single byte:

import { listAgents } from "@apowerb/apowerb-sdk";

const agents = await listAgents(); // GET /api/agents

Anywhere else, point it at the backend of your choice:

import { configureClient, listAgents } from "@apowerb/apowerb-sdk";

configureClient({
  baseUrl: "https://your-apowerb-host",
  storage: { getToken: () => process.env.APOWERB_TOKEN },
});

const agents = await listAgents(); // GET https://your-apowerb-host/api/agents

Configuration

configureClient(options) — omitted keys keep their current value.

| Option | Default | Role | |---|---|---| | baseUrl | "" | Backend root. Empty means relative requests. A trailing slash is tolerated. | | storage | authStorage (localStorage) | Must expose getToken(), ideally setToken() and clear(). | | onUnauthorized | auth:unauthorized event on window | Called on a final 401. With no DOM, it does nothing. |

getClientConfig() returns the current configuration; resetClientConfig() restores the defaults, which is useful between tests.

What the client handles for you

  • injecting the Authorization header;
  • refreshing the token on a 401, with a lock so concurrent refreshes cannot pile up, then replaying the request;
  • non-JSON responses from reverse proxies (502/503/504), turned into clean Error objects carrying status;
  • file uploads, including chunked ones.

Format

Pure ESM, published as-is — no build step. The files contain neither JSX nor any proprietary syntax, so Node and any bundler consume them directly.