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

@minimalab/indie-flags

v0.2.0

Published

Feature flags for Indie Flags — isEnabled, getValue, optional 60s cache

Readme

Indie Flags SDK

Feature flags for Indie FlagsisEnabled, getValue, optional 60s cache. Works in Node.js (18+) and browser.

Install

npm install indie-flags

Get your API key

In the Indie Flags dashboard, open your project → API Keys. Copy the client key (starts with if_pub_). Use it only in client-side or server-side code; never expose it in public repos.

Usage

Init (recommended)

Call init() on app startup to fetch all flags once and cache them for 60 seconds. Later isEnabled / getValue use the cache (no extra request per flag).

import { IndieFlags } from "indie-flags";

const flags = new IndieFlags({
  apiKey: "if_pub_xxxxxxxx",
  // baseUrl: "https://your-api.com",  // optional, for self-hosted
  // email: "[email protected]",         // optional, for flag overrides
});

await flags.init();

if (await flags.isEnabled("new-checkout")) {
  // show new checkout
} else {
  // show old checkout
}

const theme = await flags.getValue("theme"); // "dark" | "light" | "system" (string flag)

Without init

You can skip init() and call isEnabled(flagKey) or getValue(flagKey) directly. Each call will request that flag from the API (no cache unless you set cacheTtlMs and call init() yourself).

const flags = new IndieFlags({ apiKey: "if_pub_xxxxxxxx" });

const enabled = await flags.isEnabled("new-feature");
const value = await flags.getValue("ab-test-variant"); // boolean or string

Options

| Option | Type | Description | | ------------ | ------ | ---------------------------------------------------------- | | apiKey | string | Required. Project API key (client key from dashboard). | | baseUrl | string | API base URL. Default https://api.indieflags.dev. | | email | string | User email for flag overrides (targeting). | | cacheTtlMs | number | Cache TTL after init(). Default 60000. Set 0 to disable. |

Methods

  • init(): Promise<Record<string, boolean \| string>> — Fetch all flags and cache them. Call once at startup.
  • isEnabled(flagKey: string): Promise<boolean> — Whether the flag is on.
  • getValue(flagKey: string): Promise<boolean \| string> — Flag value (boolean or string for enums).
  • invalidateCache(): void — Clear cache so the next call refetches.

API

The SDK uses the Indie Flags eval API:

  • GET /eval?apiKey=...&flag=... — single flag (used when not cached).
  • GET /eval/flags?apiKey=... — all flags (used by init()).

You can also call the API directly with fetch or curl; see the dashboard Try API for examples.