Skip to main content
Migrating from v0? See the Android 0 → 4 migration guide.
Requirements: Kotlin 2.0.0+ · Java 8+ · Min SDK 23 · Compile SDK 35

1. Install the SDK

Add repositories

Ensure mavenCentral() and google() are present in your settings.gradle.kts:
If you don’t have a dependencyResolutionManagement block, add google() and mavenCentral() to your pluginManagement { repositories { ... } } block instead.

Add the dependency


2. Initialize Helium

Initialize as early as possible in your app’s lifecycle — before any paywall is shown. Your API key is available in the Helium dashboard → Profile.
HeliumEnvironment accepts PRODUCTION or SANDBOX. When in doubt, use PRODUCTION — Helium automatically treats debug builds as sandbox.

3. Show a Paywall

Before calling presentPaywall, make sure you have a trigger and workflow configured in the Helium dashboard.
presentPaywall
method

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. Identify users before calling Helium.initialize to ensure 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

Pass a PaywallEventHandlers instance when calling presentPaywall, or register it with addPaywallEventListener. Passing a LifecycleOwner is recommended — the listener is removed automatically when the lifecycle is destroyed.
If you don’t pass a LifecycleOwner, call removeHeliumEventListener() manually to avoid memory leaks.

Global event listener

Implement HeliumEventListener for centralized event handling across all paywalls:
You can also forward all events to an existing analytics provider.

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.

Advanced

Consumables

If your app sells consumable products (e.g. coins, credits, tokens), register their product IDs so Helium knows to consume them after purchase:
This only applies when using the default PlayStorePaywallDelegate. If you’re using RevenueCatPaywallDelegate, configure consumption in RevenueCat. If you’re using a custom delegate, you’re responsible for consuming purchases yourself.

RevenueCat Integration

By default, Helium manages purchases directly. If you’re already using RevenueCat, use the RevenueCatPaywallDelegate to keep RevenueCat in control.

Install

Add the RevenueCat module to app/build.gradle.kts:

Configure

Set the delegate before calling Helium.initialize, and make sure RevenueCat is already initialized:

Keeping appUserID in sync

If you change the RevenueCat appUserID, 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.
Tip: If you only need to augment the built-in logic, subclass PlayStorePaywallDelegate or RevenueCatPaywallDelegate and call super on any methods you override.
To fully replace purchase handling, implement HeliumPaywallDelegate:

Additional Methods

In most cases you don’t need this — Helium shows a loading indicator automatically if the paywall hasn’t finished downloading.downloadStatus is a Kotlin Flow that emits HeliumConfigStatus states:
Resets Helium so initialize can be called again. Useful after changing user traits that affect paywall targeting.