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

@ops-ai/react-native-toggly

v1.6.1

Published

Feature flags SDK for React Native and Expo applications. Provides hooks, context, and components for feature flag management. Can be used with or without Toggly.io.

Readme

@ops-ai/react-native-toggly

Feature flags SDK for React Native and Expo applications. Provides hooks, context, and components for feature flag management. Can be used with or without Toggly.io.

Install

npm install @ops-ai/react-native-toggly

Documentation

License

MIT — see also the repository LICENSE.

Issues

Use the structured issue templates.

Frontend telemetry

Pass a host-provided instanceId on configuration or setContext({ instanceId }). Whitespace is trimmed. Minted definitions requests use only i for targeting, removing inherited i, u, userId, g, and claim.* fields from the configured URL; unrelated query fields remain intact. Without a current token, the existing identity/group/claim request behavior applies. Context changes isolate cached definitions and pending requests.

Telemetry is enabled by default when appKey is configured. Set enableTelemetry: false to disable collection and transport; clients without an app key remain silent. metricsBaseUrl defaults to https://metrics.toggly.io and is independent of the definitions endpoint. It must be an absolute HTTP(S) base URL without credentials, query, or fragment. telemetryFlushIntervalMs defaults to 45000 ms and accepts 30000–60000 ms, with ±20% scheduling jitter. Invalid values use the default.

Each actual feature evaluation records its effective enabled/disabled leaf after entity and local gates, preserving short circuit and aggregate negation. Refreshes and snapshot projections alone do not record checks. Rendering does not imply usage or a view: call recordUsage(featureKey, variant?) or recordView(featureKey, variant?) explicitly. Optional variants must be 1–64 ASCII letters, digits, underscores, or hyphens; they label the explicit event and do not assign a feature variant.

incrementCounter(name, delta = 1) and setGauge(name, value) are app-level metrics. flushTelemetry() is awaitable and contains transport failures. onTelemetryDiagnostic receives bounded diagnostic codes. Payloads contain the app/environment, compact feature counts and metrics, plus the current normalized instanceId as i, or the current identity as u when no token is set. They never contain both. Entity attributes, groups, claims, and definitions request headers are not sent. Client-supplied identity collection must also be enabled by the server; it is disabled there by default.

One Core owner holds a bounded in-memory queue. AppState background/inactive triggers a best-effort flush; synchronous dispose() retires the owner and attempts at most one final envelope. dispose({ flush: false }) cancels pending delivery and discards queued events for owner replacement. Queue contents are not persisted by storage adapters. Native fetch uses gzip when runtime compression is available and plain JSON otherwise, without browser lifecycle APIs or a synthesized Origin header. No delivery is guaranteed during process termination.

Use the same methods from useToggly() and pass telemetry options to TogglyProvider. Changing the app key, environment, definitions base URI, telemetry opt-out, collector URL, or flush interval creates a new owner and remounts its child tree. The identity, instanceId, groups, and claims props update the current owner, including while its initial request is pending. useToggly().setContext(...) forwards these context updates to Core. Changing identity without an instance token clears the token; pass an empty token to clear it explicitly. Other configuration is captured on mount. Use a React key to replace the owner for other configuration changes.

const { recordUsage, incrementCounter, flushTelemetry } = useToggly();
function onCheckout() {
  recordUsage('checkout');
  incrementCounter('orders');
}
// Await only when the application explicitly needs a flush boundary.
await flushTelemetry();