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

@feathq/js-sdk

v0.3.1

Published

feat feature-flag SDK for JavaScript and TypeScript (server-side, OpenFeature provider)

Downloads

679

Readme


feat Node.js SDK

Server-side JavaScript / TypeScript SDK for feat feature flags. Local flag evaluation against a polled datafile, OpenFeature provider included.

For browser code, use @feathq/web-sdk. For edge runtimes via service binding, use @feathq/worker-sdk.

Install

npm install @feathq/js-sdk
# or
yarn add @feathq/js-sdk

Node.js 18+ (built-in fetch). Bun and Deno are supported.

Usage

import { FeatClient } from "@feathq/js-sdk";

const client = new FeatClient({
  apiKey: process.env.FEAT_SERVER_KEY!,    // feat_sdk_…
  url: "https://data-01.feat.so",          // optional; this is the default
});

await client.ready();

const result = await client.evaluate("checkout-v2", false, {
  targetingKey: "user-123",
  user: { plan: "pro", email: "[email protected]" },
});

if (result.value) {
  // …
}

Use a server API key (feat_sdk_…). Mobile and client-side keys are for the mobile and browser SDKs respectively.

OpenFeature

import { OpenFeature } from "@openfeature/server-sdk";
import { FeatClient, FeatProvider } from "@feathq/js-sdk";

const featClient = new FeatClient({ apiKey });
await OpenFeature.setProviderAndWait(new FeatProvider(featClient));

const client = OpenFeature.getClient();
const enabled = await client.getBooleanValue("checkout-v2", false, {
  targetingKey: "user-123",
});

How it works

  • The SDK fetches a per-environment datafile and keeps it in memory.
  • Live streaming is on by default. After the initial fetch the SDK opens a Server-Sent Events stream and applies each pushed datafile the moment it changes. Updates are applied in version order: a push is adopted only when its version is strictly newer than the one in memory.
  • A background poll keeps running as a safety net (slow while the stream is healthy). If the stream cannot establish or drops, the SDK falls back to polling at the normal interval and keeps retrying the stream with backoff.
  • Set streaming: false to rely on polling alone. Poll cadence is pollIntervalMs (default 30 s, floored at 5 s). ETag-aware: unchanged polls are 304s.
  • Evaluation is local; no per-flag network call.
  • Call client.close() to tear down the stream and poll loop.
  • url must use https:// if you override it (the constructor rejects plaintext URLs except http://localhost for tests).

License

MIT