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

@entitlehub/react-native

v0.1.7

Published

EntitleHub for React Native & Expo — one call to purchase and unlock entitlements. Wraps expo-iap for the native store sheet and validates receipts via EntitleHub.

Readme

@entitlehub/react-native

npm version license MIT

EntitleHub for React Native & Expo — one call to purchase and unlock entitlements. It opens the native store sheet (via expo-iap), validates the receipt with EntitleHub server-side, and hands you the updated entitlements. The RevenueCat developer experience, on EntitleHub.

npx expo install expo-iap
npm install @entitlehub/react-native @entitlehub/sdk

Use

import {
  configureEntitleHub, purchaseProduct, getCustomerInfo, restorePurchases, isEntitled,
} from "@entitlehub/react-native";

// once, after your own login:
await configureEntitleHub({ apiKey: "pk_live_…", appUserId: user.id });

// gate a feature:
if (await isEntitled("pro")) unlockPro();

// buy — opens the native sheet, validates, returns entitlements:
const info = await purchaseProduct("app_pro_monthly", { isSubscription: true });
if (info.isActive("pro")) unlockPro();

// restore:
const restored = await restorePurchases();

| Function | What it does | |---|---| | configureEntitleHub({ apiKey, appUserId, baseUrl? }) | Configure + open the store connection. | | purchaseProduct(productId, { isSubscription? }) | Native purchase → validate with EntitleHub → returns CustomerInfo. | | restorePurchases() | Re-validate the store's purchases, return CustomerInfo. | | getCustomerInfo() / isEntitled(id) | Read entitlements. | | getOfferings() / getProducts(ids) | Catalog metadata / live store prices. | | logIn(appUserId) | Switch the acting user. | | addCustomerInfoUpdateListener(fn) | React to entitlement changes. |

Only your publishable key (pk_) ships in the app. EntitleHub validates the Apple/Google receipt server-side, so a forged one is rejected — no secret key on the device.

How it works

purchaseProduct calls expo-iap to open the StoreKit / Play Billing sheet, then reports the resulting receipt to EntitleHub: the iOS StoreKit 2 JWS, or the Android purchase token. EntitleHub verifies it (Apple root CA / Google Play API), writes the entitlement grant, and returns the customer info. Renewals/refunds stay current via server-to-server notifications.

Full guide: entitlehub.com/docs/purchases.

Choosing / pinning the store library

The on-device purchase runs through expo-iap (OpenIAP). That native layer is the store library's responsibility, not EntitleHub's — and a given version can have platform-specific native bugs. If you hit a native IAP crash (e.g. an EXC_BAD_ACCESS in the store module), it's the store library, not this SDK or your app code, and no JS change can catch a native exception thrown off the JS thread.

Two levers, both without changing this SDK:

  • Pin a working version: npm install expo-iap@<version> — this package uses whatever expo-iap is installed (peer dependency).
  • Supply your own module: pass any OpenIAP-compatible library to configureEntitleHub:
    await configureEntitleHub({ apiKey, appUserId, iap: require("expo-iap") }); // or react-native-iap

Fully decoupled fallback: skip this package and use @entitlehub/sdk directly — open the purchase with any billing library you've verified on your target OS, then call eh.reportPurchase({ signedTransaction | purchaseToken }). See Purchases → manual.

Requires a development build (Expo Go has no in-app-purchase native module). The entitlement layer is @entitlehub/sdk; this package adds the purchase flow on top.