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

@invinite-org/api-client

v0.7.0

Published

Typed TypeScript/JavaScript client for the Invinite Web API

Readme

@invinite-org/api-client

Typed TypeScript / JavaScript client for the Invinite Web API — the workspace REST API at api.invinite.com. It is generated from the same endpoint registry that powers the REST API and the inv CLI, so its request and response models always match the reference.

The client uses typescript-fetch (native fetch, zero runtime dependencies) and works in Node.js 18+ and modern browsers.

The generated surface includes the curated team activity stream and its full-fidelity per-entity history, plus alert fire-history time ranges, per-alert events, and summary counts.

Install

npm install @invinite-org/api-client

Authentication

Create a Configuration with your invw_ Web API token as the access token. The client sends it as an Authorization: Bearer <token> header on every request.

import { Configuration } from "@invinite-org/api-client";

const config = new Configuration({
    accessToken: process.env.INVINITE_CLI_TOKEN
});

Team-scoped endpoints take the team as a per-method xTeamId argument — not a global default header.

Quickstart

Configure the client, call users/me to discover your team id, then make a team-scoped list call.

import { Configuration, UsersApi, WorkspaceApi } from "@invinite-org/api-client";

const config = new Configuration({
    accessToken: process.env.INVINITE_CLI_TOKEN
});

// 1. Find the team to operate on.
const me = await new UsersApi(config).usersMe();
const teamId = me.data.teams[0].id;

// 2. Make a team-scoped list call.
const spaces = await new WorkspaceApi(config).spacesList({
    xTeamId: teamId,
    limit: 50
});

for (const space of spaces.data.items) {
    console.log(space);
}

Pagination

List methods return data.items plus data.nextCursor. Pass the cursor back on the next call until it is null.

const api = new WorkspaceApi(config);
let cursor: string | undefined = undefined;
do {
    const page = await api.spacesList({ xTeamId: teamId, limit: 50, cursor });
    for (const space of page.data.items) {
        // process space ...
    }
    cursor = page.data.nextCursor ?? undefined;
} while (cursor);

Error handling

On a non-2xx response the client throws ResponseError. Read the standard { ok: false, error, code } envelope from the response:

import { ResponseError } from "@invinite-org/api-client";

try {
    await new WorkspaceApi(config).spacesList({ xTeamId: teamId });
} catch (error) {
    if (error instanceof ResponseError) {
        const body = await error.response.json(); // { ok: false, error, code }
        console.error(error.response.status, body.code, body.error);
    } else {
        throw error;
    }
}

Regeneration

This client is a generated artifact. If an endpoint's types look wrong, the fix belongs in the endpoint registry rather than in hand-written client code — regenerating re-derives every model from the schema. Releases are published on sdk-v* tags.

Links