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

@seoulcomix-hub/rn-dev-flag

v0.0.6

Published

A React Native package for managing feature flags in development environments.

Readme

RN Dev Flag

A React Native package for managing feature flags in development environments.

Installation

npm install @seoulcomix-hub/rn-dev-flag
# or
yarn add @seoulcomix-hub/rn-dev-flag

Prerequisites

This package has the following peer dependencies:

  • @tanstack/react-query: >=5.0.0
  • react: >=18
  • react-native: >=0.73
  • react-native-safe-area-context: >=4.0.0
  • expo-application: >=6.0.0

Ensure these are installed in your project.

Usage

Setting up the Provider

Wrap your application or component tree with the DevFlagProvider:

import { DevFlagProvider } from "@seoulcomix-hub/rn-dev-flag";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const queryClient = new QueryClient();

export default function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <DevFlagProvider
        projectName="your-project-name"
        enabled={
          process.env.EXPO_PUBLIC_PROJECT_ENV === "Development" ||
          process.env.EXPO_PUBLIC_PROJECT_ENV === "Local"
        }
      >
        {/* Your app components */}
      </DevFlagProvider>
    </QueryClientProvider>
  );
}

Important: The DevFlagProvider must be used inside a QueryClientProvider from @tanstack/react-query as it relies on React Query for data fetching.

Using Dev Flags in Components

There are two main hooks for accessing dev flags:

  1. useDevFlags() - Access all dev flags, project information, and control methods
  2. useDevFlag(key) - Check if a specific feature flag is enabled
import { useDevFlag, useDevFlags } from "@seoulcomix-hub/rn-dev-flag";

function MyComponent() {
  // Check a specific flag
  const isNewFeatureEnabled = useDevFlag("new-feature");

  if (isNewFeatureEnabled) {
    return <NewFeature />;
  }

  return <LegacyFeature />;
}

Important: If the enabled prop in DevFlagProvider is not true, all dev flags will always return false. This ensures that development features are not accidentally enabled in production environments.

Dev Flag Management UI

The package includes a built-in screen component for managing dev flags:

import { DevFlagScreen } from "@seoulcomix-hub/rn-dev-flag";

function DevSettingsScreen() {
  return <DevFlagScreen />;
}

This screen allows developers and QA people to:

  • View all available feature flags
  • Toggle flags on/off
  • See their device ID
  • Refresh the flags from the server

API Reference

Components

  • DevFlagProvider: Context provider that fetches and manages dev flags
    • Props:
      • projectName (required): Name of your hub project
      • children: React components

Hooks

  • useDevFlags(): Access the dev flag context

    • Returns:
      • devFlags: Array of dev flag objects
      • projectName: Current project name
      • deviceId: Device identifier
      • refetch: Function to refresh dev flags
      • isLoading: Boolean indicating if flags are loading
  • useDevFlag(key): Check if a specific flag is enabled

    • Parameters:
      • key: String identifier for the flag
    • Returns:
      • Boolean indicating if the flag is enabled
      • Note: Always returns false if enabled prop from DevFlagProvider is not true

DevFlag Object Structure

interface DevFlag {
  id: string; // Unique identifier
  key: string; // Feature flag key
  enabled: boolean; // Flag status
}

Server Integration

This package connects to a server endpoint to manage flags. The API endpoint used is: https://api.hub.seoulcomix.com/project/dev-flags/

Note: Creation and management of dev flags can be done through the Seoulcomix Hub site. Visit the Hub dashboard to create new dev flags for your project before using them in your application.