Using an older SDK version?If you’re upgrading from SDK v0.x, check our Migration Guide for breaking changes and upgrade instructions.
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
Install the SDK using your preferred package manager:Configuration
Follow these steps to integrate the SDK.HeliumProvider
Initialization
Initialize Helium by callinginitialize() early in your app’s lifecycle, typically in your root component.
If you are using RevenueCat, check out the example in the next section.
Use RevenueCat with Helium
Important Make sure that you’ve already:- Installed RevenueCat (if non-Expo go here)
- (Recommended) Configured an Entitlement
Presenting Paywalls
Use thepresentUpsell method to present a paywall. presentUpsell takes in PresentUpsellParams:
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.
2. Provide a fallback bundle (recommended)
Provide a fallback bundle as described in this guide.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 2 seconds). You can configure, turn off, or set trigger-specific loading budgets. If the budget expires before the paywall is ready, a fallback paywall will show if available otherwise the loading state will hide andonFallback will be called.
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:Paywall Events
Helium emits various events during the lifecycle of a paywall. If desired, you can handle these events in theonHeliumPaywallEvent callback. See Helium Events for more details.