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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tryheliumai/expo-helium

v0.1.0

Published

Helium paywalls expo sdk

Downloads

3

Readme

helium-expo-sdk

Background

Get set up with the Helium SDK for iOS in 5 minutes. Reach out over your Helium slack channel, or email [email protected] for any questions.

Expo installation

Install the package by running:

npx expo install @tryheliumai/expo-helium

We recommend using Expo 53 and up.

Configuration

Initialization

Initialize Helium by calling initialize() early in your app's lifecycle, typically in your root component. initialize takes in a configuration object that includes your purchase config, event handlers, and other settings. (If you are using RevenueCat, skip to the next section.)

import { initialize, createCustomPurchaseConfig } from '@tryheliumai/expo-helium';

function App() {
  useEffect(() => {
    initialize({
      // Helium provided api key
      apiKey: '<your-helium-api-key>',

      // Custom user id - e.g. your amplitude analytics user id. 
      customUserId: '<your-custom-user-id>',

      // Purchase configuration (see next section if using RevenueCat)
      purchaseConfig: createCustomPurchaseConfig({
        makePurchase: async (productId) => {
          // Your purchase logic here
          return { status: 'purchased' };
        },
        restorePurchases: async () => {
          // Your restore logic here
          return true;
        }
      }),

      // Event handler for paywall events
      onHeliumPaywallEvent: (event) => {
        switch (event.type) {
          case 'paywallOpen':
            break;
          case 'ctaPressed':
            if (event.ctaName === HELIUM_CTA_NAMES.SCHEDULE_CALL) {
              // Handle schedule call
            }
            break;
          case 'subscriptionSucceeded':
            // Handle successful subscription
            break;
        }
      },

      // Custom user traits
      customUserTraits: {
        "example_trait": "example_value",
      },

    });
  }, []);
}

Use RevenueCat with Helium

Important Make sure that you've already:

  • installed and configured RevenueCat's Purchases client - if not, follow https://www.revenuecat.com/docs/getting-started/configuring-sdk for more details.
  • have packages configured for each apple app store SKU
  • assigned one of your Offerings as "default"
  • initialize RevenueCat (Purchases.configure()) before initializing Helium
import { HELIUM_CTA_NAMES } from '@tryheliumai/expo-helium';
import { createRevenueCatPurchaseConfig } from "@tryheliumai/expo-helium/src/revenuecat";

const asyncHeliumInit = async () => {
  initialize({
    apiKey: '<your-helium-api-key>',
    customUserId: '<your-custom-user-id>',
    purchaseConfig: createRevenueCatPurchaseConfig(),
    onHeliumPaywallEvent: (event) => {
      switch (event.type) {
        case 'subscriptionFailed':
          // Custom logic
          break;
        case 'subscriptionSucceeded':
          // Handle a subscription success event
          // e.g. navigate to a premium page
          break;
      }
    },
    // RevenueCat ONLY: supply RevenueCat appUserId
    // (and initialize RevenueCat before Helium initialize)
    revenueCatAppUserId: await Purchases.getAppUserID()
  });
};

useEffect(() => {
  void asyncHeliumInit();
}, []);

Presenting Paywalls

presentUpsell takes in a dictionary specifying the triggerName as well as an optional onFallback parameter defining custom fallback behavior (in case the user didn't have a network connection)

import { presentUpsell } from '@tryheliumai/expo-helium';

function YourComponent() {
  const handlePremiumPress = useCallback(async () => {
    await presentUpsell({
      triggerName: 'premium_feature_press',
      onFallback: () => {
        // Logic to open a default paywall
        openFallbackPaywall();
      }
    });
  }, [presentUpsell]);

  return (
    <Button title="Try Premium" onPress={handlePremiumPress} />
  );
}

Paywall Events

Helium emits various events during the lifecycle of a paywall. You can handle these events in your payment delegate. See the Helium Events for more details.