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

flowauth

v1.0.10

Published

AuthService SDK for TypeScript/JavaScript

Readme

AuthService SDK

Endpoint headers

  • POST /v1/auth/signup, POST /v1/auth/login, POST /v1/auth/google, GET /v1/projects/config, GET /v1/plans -> send X-Public-Key.
  • GET /v1/auth/me, POST /v1/auth/logout, POST /v1/plans/{planId}/subscribe, GET /v1/user/subscription, DELETE /v1/user/subscription, GET /v1/user/roles, GET /v1/user/permissions -> send X-Secret-Key plus the active session token (X-Session-Id or sdk_session cookie).
  • Cookie-protected endpoints (/v1/auth/me, /v1/auth/logout, /v1/plans/{planId}/subscribe, /v1/user/subscription, /v1/user/roles, /v1/user/permissions) require the sdk_csrf cookie echoed in the X-CSRF-Token header. The SDK stores the CSRF token from auth responses under auth_csrf_token_${scope} and reuses it if the cookie is not readable.

Sessions & cookies

  • Sessions last 24h; the SDK stores session tokens per project scope and reuses the signed value returned by the API or the pre-set sdk_session cookie.
  • Requests always include credentials so sdk_session/sdk_csrf cookies travel with the call.
  • Session data is never shared across projects (projectId/publicKey/secretKey/apiUrl are used to namespace the persisted session).

RBAC checks

  • has({ role }) and has({ permission }) query the logged-in user's roles/permissions for the current project.
  • For tenant-aware checks, ensure the SDK is configured with the correct project scope (projectId or keys) per tenant.

State sync

  • The SDK caches currentPlan, subscription, roles, and permissions per project scope in memory and localStorage.
  • Access the cached values through getState() and rely on the SDK to sync them when it receives API responses.

Error handling

  • 401/403 → generic reauthentication error and session reset.
  • 429 → exponential backoff respecting Retry-After when present, then a generic rate-limit error.
  • Other errors are surfaced with a generic message while preserving details when available.

Example

import { createAuthClient } from "@authservice/sdk";

const auth = createAuthClient({
  projectId: "proj_123",
  publicKey: "pk_live_123",
  secretKey: "sk_live_123",
  apiUrl: "https://api.your-auth.com",
});

await auth.signIn({ email: "[email protected]", password: "secret" });
const me = await auth.getUser(); // uses X-Secret-Key + X-CSRF-Token and current session