1. Install the SDK
pubspec.yaml, run:
Enable Swift Package Manager (recommended)
Set minimum iOS version
Inios/Podfile, ensure the minimum deployment target is set:
2. Initialize Helium
Callinitialize in main.dart before runApp. Your API key is available in the Helium dashboard → Profile.
3. Show a Paywall
Before callingpresentUpsell, make sure you have a trigger and workflow configured in the Helium dashboard.
Do not callpresentUpsellinsideWidget build()— this can cause unpredictable behavior.
Recommended Setup
The following steps are optional but strongly recommended for production apps.Identify Users
User identification is optional. It improves targeting accuracy and event attribution in external analytics. Set user identity duringinitialize for consistency from the first session.
Paywall Events
Helium emits events throughout the paywall lifecycle. You can handle them per-presentation or globally.Per-presentation handlers
PasseventHandlers to presentUpsell:
Global event listener
ImplementHeliumCallbacks and pass it to initialize to handle events across all paywalls without passing handlers at each call site:
Fallback Paywalls
Set up fallbacks to handle the rare case where a paywall fails to load. This is strongly recommended before going to production. Follow the fallback bundle guide once you have a production paywall ready.Checking Entitlements
Check entitlement status before showing a paywall to avoid showing it to users who are already subscribed.All Entitlement Methods
All Entitlement Methods
Advanced
RevenueCat Integration
By default, Helium manages purchases directly. If you’re already using RevenueCat, use thehelium_revenuecat package to keep RevenueCat in control.
Install
Configure
Initialize RevenueCat first, then passRevenueCatPurchaseDelegate to heliumFlutter.initialize:
Keeping appUserID in sync
If you change the RevenueCatappUserID, sync the value to Helium:
Custom Purchase Handling
By default, Helium handles purchases for you. This section is for apps that need custom purchase logic. ImplementHeliumPurchaseDelegate and pass it to initialize:
Additional Methods
Check Download Status
Check Download Status
In most cases you don’t need this — Helium shows a loading indicator automatically if the paywall hasn’t finished downloading.Subscribe to the Possible values:
downloadStatus stream to observe changes:notDownloadedYet · inProgress · downloadSuccess · downloadFailureFor a simple boolean check:Reset Helium
Reset Helium
Resets Helium so
initialize can be called again. Useful after changing user traits that affect paywall targeting.