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

@supashiphq/react-native-sdk

v1.1.0

Published

Supaship SDK for React Native

Readme

Supaship React Native SDK

Supaship SDK for React Native: same hooks and provider model as @supashiphq/react-sdk.

Installation

npm install @supashiphq/react-native-sdk

Peer dependencies: react, react-native (≥ 0.71). The core HTTP client ships inside @supashiphq/javascript-sdk via this package’s dependencies.

Quick start

import { SupashipProvider, useFeature, FeaturesWithFallbacks } from '@supashiphq/react-native-sdk'
import { View, Text } from 'react-native'

const features = {
  'new-header': false,
  'theme-config': { mode: 'dark' as const, showLogo: true },
} satisfies FeaturesWithFallbacks

export function App() {
  return (
    <SupashipProvider
      config={{
        sdkKey: 'your-sdk-key',
        environment: 'production',
        features,
        context: { userId: '123' },
        toolbar: false,
      }}
    >
      <Home />
    </SupashipProvider>
  )
}

function Home() {
  const { feature: newHeader, isLoading } = useFeature('new-header')
  if (isLoading) return <Text>Loading…</Text>
  return <View>{newHeader ? <Text>New</Text> : <Text>Old</Text>}</View>
}

Use toolbar: false in native apps (the dev toolbar targets browsers only).

Type-safe feature flags

Declare flags once, then augment this package so hooks stay typed:

// features.ts
import { FeaturesWithFallbacks, InferFeatures } from '@supashiphq/react-native-sdk'

export const FEATURE_FLAGS = {
  'new-header': false,
  'theme-config': { mode: 'dark' as const, showLogo: true },
} satisfies FeaturesWithFallbacks

declare module '@supashiphq/react-native-sdk' {
  interface Features extends InferFeatures<typeof FEATURE_FLAGS> {}
}

After that, useFeature('new-header') and useFeature('theme-config') infer correct value types. Invalid keys are a TypeScript error.

Use cases

Several flags in one request

import { useFeatures } from '@supashiphq/react-native-sdk'

function Dashboard() {
  const { features, isLoading } = useFeatures(['new-header', 'paywall-v2'] as const, {
    context: { plan: 'pro' },
  })
  if (isLoading) return <Text>…</Text>
  return <Text>{features['paywall-v2'] ? 'Paywall B' : 'Paywall A'}</Text>
}

Declarative boolean gate (SupashipFeature)

import { SupashipFeature } from '@supashiphq/react-native-sdk'
import { View, Text } from 'react-native'

function Header() {
  return (
    <SupashipFeature
      feature="new-header"
      loading={<Text>…</Text>}
      variations={{
        true: <Text>New header</Text>,
        false: <Text>Legacy header</Text>,
      }}
    />
  )
}

Children are normal ReactNode values (View, Text, etc.).

Update targeting context after login

import { useFeatureContext } from '@supashiphq/react-native-sdk'
import { useEffect } from 'react'

function SessionBridge({ userId }: { userId: string | undefined }) {
  const { updateContext } = useFeatureContext()
  useEffect(() => {
    if (userId) updateContext({ userId })
  }, [userId, updateContext])
  return null
}

Merging behavior matches the web SDK (mergeWithExisting defaults to true).

Advanced: useClient and useQuery

import { useClient, useQuery } from '@supashiphq/react-native-sdk'

function RemoteConfig() {
  const client = useClient()
  const { data, isLoading } = useQuery(['remote-config'], () =>
    client.getFeature('theme-config').then(theme => ({ theme }))
  )
  if (isLoading || !data) return null
  return <Text>{JSON.stringify(data.theme)}</Text>
}

refetchOnWindowFocus on useQuery still uses that name for API parity; on native it refetches when the app becomes active again.

refetchOnWindowFocus and AppState

| Platform | Trigger for refetch (when option is true) | | -------- | ------------------------------------------- | | Web SDK | Browser visibilitychange / window focus | | Native | AppState transitions to active |

Defaults for useFeature / useFeatures keep network minimal (refetchOnWindowFocus: off unless you opt in).

Sensitive context hashing

If you set sensitiveContextProperties, hashing uses Web Crypto where available. Some Hermes setups need a crypto.subtle polyfill; see @supashiphq/javascript-sdk for details.

Unit testing in your app

Same idea as the React SDK: wrap in SupashipProvider with test config and toolbar={false}, then render your screen.

If Jest resolves react-native from this package’s internals, add a tiny stub so tests do not need the full native binary:

// jest.config.js
module.exports = {
  moduleNameMapper: {
    '^react-native$': '<rootDir>/test/react-native-stub.js',
  },
}
// test/react-native-stub.js
exports.AppState = {
  addEventListener() {
    return { remove() {} }
  },
}

License

MIT — see LICENSE.