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

circleso

v1.0.1

Published

Circleso async client

Readme

circleso

TypeScript SDK for Circle's Admin V2, Headless Member V1 and Headless Auth APIs. Typed requests and responses, ESM/CJS exports, retries, timeouts, pagination and token refresh.

Installation

Install the stable release:

npm install [email protected]

See v1 release notes for details and migration from 0.3.0 for breaking changes. latest selects 1.0.1; next currently selects 1.0.0-rc.1.

Requires Node.js 22 or 24. TypeScript users need 5.9.3 or newer and DOM/Fetch types. The Member client also supports browsers and browser workers with Fetch and CORS support. Admin, Auth and built-in token refresh run on your server.

Quick start

Admin API

Create an Admin V2 token in Circle and keep it on your server:

import { createAdmin } from "circleso/admin";

const token = process.env.CIRCLE_ADMIN_TOKEN;
if (!token) throw new Error("Missing CIRCLE_ADMIN_TOKEN.");

const admin = createAdmin({ token, timeoutMs: 10_000 });
const posts = await admin.posts.list({ page: 1, per_page: 20 });
console.log(posts?.records ?? []);

Member API

Use a member access token issued by your authenticated server. Keep Headless Auth application tokens and member refresh tokens on the server.

import { createHeadless } from "circleso/headless";

const accessToken = process.env.CIRCLE_HEADLESS_TOKEN;
if (!accessToken) throw new Error("Missing CIRCLE_HEADLESS_TOKEN.");

const member = createHeadless({ accessToken, timeoutMs: 10_000 });
const bookmarks = await member.bookmarks.list({ page: 1, per_page: 20 });
console.log(bookmarks?.records ?? []);

The example above runs on Node. In a browser, obtain the member token from your own server; see authentication and cookies for token issuance, refresh and browser integration.

Choose a client

| Import | Purpose | Credential | | --- | --- | --- | | circleso/admin → createAdmin | Community administration | Admin V2 token | | circleso/headless → createHeadless | Member actions | Member access token | | circleso/auth → createAuth | Issue, refresh and revoke tokens | Headless Auth application token | | circleso → CircleSo | All three clients together on a server | Credentials for each client |

All entry points support ESM import and CommonJS require. Each client exposes a typed raw OpenAPI client for lower-level requests.

Configuration

  • baseUrl defaults to https://app.circle.so.
  • Admin's communityHost sets its Host header, defaults to app.circle.so, and requires a custom server transport when it differs from the destination. Native Fetch removes Host overrides.
  • timeoutMs covers each attempt through response-body completion. Set it explicitly; the default has no deadline. Pass a per-call signal to cancel across retries.
  • Retries default to two for eligible methods and failures, including rate limits. POST/PATCH are not retried by default. For deliberate mutations, set retries: { retries: 0 }.
  • Named methods take flat query/body options, for example { page: 1, per_page: 20 }.

See client configuration for all options, retry behavior, token refresh and redacted logging, and request options for serialization.

Error handling

Named methods throw SDK errors. Catch CircleHttpError for HTTP failures:

import { CircleHttpError, createAdmin } from "circleso/admin";

const token = process.env.CIRCLE_ADMIN_TOKEN;
if (!token) throw new Error("Missing CIRCLE_ADMIN_TOKEN.");
const admin = createAdmin({ token, timeoutMs: 10_000 });

try {
  await admin.posts.list({ page: 1, per_page: 20 });
} catch (error) {
  if (error instanceof CircleHttpError) {
    console.error("Circle request failed", error.status);
  } else {
    throw error;
  }
}

Other failures use CircleNetworkError, CircleTimeoutError or CircleConfigError. Raw clients return { data, error, response } for HTTP responses; check response.ok. Error bodies and causes may contain sensitive data; keep diagnostics redacted.

Documentation

License

MIT