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

@geejay/use-feature-flags

v1.0.31

Published

``` _____ ___ ____ ___ _ ____ |_ _/ _ \| __ )_ _| / \ / ___| | || | | | _ \| | / _ \ \___ \ | || |_| | |_) | | / ___ \ ___) | |_| \___/|____/___/_/ \_\____/

Readme

@geejay/use-feature-flags

 _____ ___  ____ ___    _    ____  
|_   _/ _ \| __ )_ _|  / \  / ___| 
  | || | | |  _ \| |  / _ \ \___ \ 
  | || |_| | |_) | | / ___ \ ___) |
  |_| \___/|____/___/_/   \_\____/ 
                                   

TOBIAS — the Totally Optimized Bot for Intelligent App Switching (Safe). A tiny React hook that lets you manage feature flags at runtime across React, React Native, and React Native Web—no redeploys required.


✨ What you get

  • Drop-in hook: useFeatureFlags() returns isActive(flag) and loading.
  • Instant toggles: Flip features on/off without reloading your app.
  • Multi-environment: Scope flags to dev, staging, prod, previews, etc.
  • Multi-tenant: Keep flags organized per customer or workspace.
  • Friendly UI: Manage flags from a simple web dashboard.
  • TOBIAS Cleanup: Our companion bot scans for stale flags and opens PRs to safely remove them, so your codebase stays clean without the busywork.

🚀 Installation

npm install @geejay/use-feature-flags
# or
yarn add @geejay/use-feature-flags

Here’s the updated Quick Start section with your note about the environment parameter baked in — so readers know it’s usually not needed.


⚡️ Quick start

One-time init: Pass your API key on the first call anywhere in your app. Thereafter: Just call useFeatureFlags() with no arguments — the key is remembered.

The environment parameter is optional — in most cases you don’t need it. If omitted, the app will auto-detect based on the domain:

  • Web: Uses the current domain (e.g. myapp.com, staging.myapp.com)
  • Local dev: Uses "localhost" when testing locally

Example: first call (e.g., in your root)

// App.tsx
import { useFeatureFlags } from '@geejay/use-feature-flags';

export default function App() {
  // ✅ Initialize once with your API key
  // Environment is optional — auto-detects in most cases
  const { loading } = useFeatureFlags("YOUR-API-KEY");

  if (loading) return null;
  return <MainRoutes />;
}

Example: subsequent calls (no key needed)

// components/Dashboard.tsx
import { useFeatureFlags } from '@geejay/use-feature-flags';

export default function Dashboard() {
  // ✅ No API key here — it’s already remembered
  const { isActive, loading } = useFeatureFlags();

  if (loading) return null;
  return isActive('new-dashboard') ? <NewDashboard /> : <OldDashboard />;
}

Another component, still no key

// components/Header.tsx
import { useFeatureFlags } from '@geejay/use-feature-flags';

export function Header() {
  const { isActive } = useFeatureFlags(); // ✅ key remembered globally
  return isActive('show-announcement') ? <Banner /> : null;
}

Notes

  • Pass the API key only once — the hook remembers it for all future calls in the same session.
  • Environment is usually not required — the hook will detect it automatically.

Tips

  • Call useFeatureFlags("YOUR-API-KEY", "production") if you want to force the app to use a specific custom environment. Maybe useful for mobile users??
  • You can read multiple flags; isActive is stable and fast.

🧰 Flag management

Use the hosted dashboard to:

  • Create/edit/delete flags
  • Group by environment and tenant
  • Toggle in real time and see changes reflected instantly

Get started: https://featureflags-ai.netlify.app/


🤖 TOBIAS: automatic flag cleanup PRs

Your team shouldn’t spend Fridays hunting down dead flags. TOBIAS keeps your repo tidy by:

  • scanning for stale/retired flags
  • generating safe diffs (removing unused checks, dead branches, and config)
  • opening pull requests with a friendly summary and checklist

Example PR title:

🧹 TOBIAS: remove stale flags (billing_v2, heroA/B)

Example PR body snippet:

This automated PR removes stale flags detected by TOBIAS.

- Removed: `billing_v2`, `heroA/B`
- Updated: related conditionals and config
- Notes: All changes are no-op at runtime

Review checklist:
- [ ] CI passes
- [ ] Screens relying on removed flags look correct

🧪 Local dev notes

  • Works with React 18 (including Strict Mode).
  • Designed for modern bundlers (Next.js, Vite, Expo/Metro).
  • If you test the library locally via yalc, remember to remove the yalc reference before deploying your app.

🤝 Contributing

Issues and PRs welcome! If you’ve got ideas for smarter cleanup rules or integrations, open a ticket—TOBIAS loves new tricks.


📄 License

MIT © GeeJay