Skip to main content

Background

Get set up with the Helium SDK for React Native. Reach out over your Helium slack channel or email founders@tryhelium.com for any questions.

Installation

Find your API key here
Install the SDK using your preferred package manager:
We support Expo 49+ but recommend using Helium with Expo 53 and up. If you’re on an older version and having issues, ping us - we’ve got experience with all kinds of versioning, upgrade, and custom build plugin work.
The Older Expo / Bare SDK supports iOS only.The Expo 52+ SDK supports both iOS and Android.

Configuration

Follow these steps to integrate the SDK.

Initialization

Initialize Helium by calling initialize() early in your app’s lifecycle, typically in your root component.
If you are using RevenueCat, follow the example in the next section.

Use RevenueCat with Helium

If you haven’t already, make sure to install RevenueCat (for non-Expo see here).

Custom Purchase Config

To use your own purchase logic, pass in a custom purchase config to initialize.

Custom User ID and Custom User Traits

You can pass in a custom user ID and custom user traits if desired to initialize:

Presenting Paywalls

You must have a trigger and workflow configured in the dashboard in order to show a paywall.
Use the presentUpsell method to present a paywall. presentUpsell takes in PresentUpsellParams:
PresentUpsellParams
method

PaywallEventHandlers

You can pass in paywall event handlers to listen for specific paywall events. (See the next section Helium Events for a way to handle global events).
You should now be able to see Helium paywalls in your app! Well done! 🎉

Helium Events

Listen for all Helium Events by implementing onHeliumPaywallEvent and passing it to initialize:

Checking Subscription Status & Entitlements

If you use an external payment processor like Stripe, Helium’s entitlement helpers may not be reliable. We recommend implementing your own entitlement checking in that case. If you use Stripe with RevenueCat, we recommend using RevenueCat’s entitlement APIs instead.
Use these methods to check current user subscription status.

Example Usage

Check entitlements before showing paywalls to avoid showing a paywall to a user who should not see it.

Fallbacks

There are currently two ways you can handle a “fallback” situation in the rare case that a paywall fails to download or an invalid trigger is provided. You can also do both. Better to be prepared!

1. Use the onFallback function

You can pass this in when you call presentUpsell and handle however you want. Provide a fallback bundle as described in this guide.
Update your fallback bundle whenever you make changes to your paywall for maximum reliability.

Loading Budgets

If a paywall has not completed downloading when you attempt to present it, a loading state can show. By default, Helium will show this loading state as needed (a shimmer view for up to 7 seconds). You can configure or turn off this loading budget. If the budget expires before the paywall is ready, a fallback paywall will show if available otherwise the loading state will hide and onFallback will be called.

Advanced

Reset Helium entirely so you can call initialize again. Only for advanced use cases.

Additional Considerations

Expo Development Build

Please note that the Helium SDK uses native code, so you must create a development build. A common command to run for this is:

Troubleshooting

Check if the Helium SDK is installed

If the package is not found, install it again:

Check if Helium is properly installed

To verify that the Helium pod is correctly installed in your project, run:
If not found, try these commands: