> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryhelium.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Helium is a paywall platform for mobile apps. Paywalls, workflows, triggers, targeting and experiments are configured in the dashboard (https://app.tryhelium.com); the SDK's job is to initialize, present a paywall for a trigger, and report purchases.
> Pick the SDK page for the user's platform: /sdk/quickstart-ios (Swift), /sdk/quickstart-android (Kotlin), /sdk/quickstart-react-native, /sdk/quickstart-flutter. Method names differ per platform; copy them from the page for that platform, never from another platform's page.
> Pages under /sdk/quickstart-ios-v3 and /sdk/quickstart-android-v0 are legacy SDK versions. Use them only when the user is on that version; for upgrades use the /migrations pages.
> For live dashboard data (paywalls, workflows, metrics) connect the Helium MCP server at https://app.tryhelium.com/api/mcp (see /ai-tools/mcp). For SQL over events, revenue, subscriptions and users use the Data Access API (/data-access/overview) and the helium-data-access skill (/data-access/agent-skill). This documentation site also exposes a docs-search MCP server at https://docs.tryhelium.com/mcp.
> Web checkout (App2Web) with Stripe or Paddle is a separate flow from in-app purchases; start at /web-checkout/overview.
> Every page is available as Markdown by appending .md to its URL. The full index is at https://docs.tryhelium.com/llms.txt.

# Set Up Revenue Tracking

> Set up webhooks to track your app's revenue and subscription events. This is important if you want Helium to display subscription, revenue, and other metrics!

Go to [Integrations > Revenue Tracking](https://app.tryhelium.com/integrations/revenue) to configure webhooks.

![Rev Reporting](https://mintcdn.com/helium/vjbIVTFp_dv4L6zW/images/rev-reporting.jpg?fit=max\&auto=format\&n=vjbIVTFp_dv4L6zW\&q=85\&s=5a727d069f4d286dc69bef830718bddb)

## Configure iOS

Choose ONE of the following 3 options:

### 1) App Store Server Notifications

> [!TIP]
>
> This option is recommended if you are using StoreKit to handle your purchases.

Send purchase events direct from Apple to Helium.

### 2) RevenueCat Webhooks

> [!TIP]
>
> This option is recommended if you are using RevenueCat to handle your purchases.

Use RevenueCat webhooks to send revenue events to Helium. Follow the instructions shown under **RevenueCat Webhooks**.

### 3) Forward App Store Server Notifications

> [!TIP]
>
> This option is recommended if you are using StoreKit to handle your purchases but want to consume App Store Server Notifications on your own server and forward those events to Helium.

Grab the **Webhook URL** from the **App Store Server Notifications** section and use that value in your forwarding code.

In your existing App Store Server Notifications handler, add a snippet that forwards the payload to Helium **unchanged**. Place it as early as possible — after you've parsed the incoming body, but before any type filtering or early returns — so that Helium receives *every* notification type, not just the subset your own handler acts on.

**Don't couple your response to the forward.** Await the forward and wrap it in a `try/catch` that only logs on failure. It should never throw or change the status you return to Apple — otherwise a hiccup forwarding to Helium would make Apple retry the whole notification and re-run your own handling.

Forwarding is just a POST — send the request body to your Helium Webhook URL with `Content-Type: application/json`. The examples below cover a few common stacks, but any language works. Reach out to Helium support if you have any questions.

```javascript Node/Express theme={null}
// Inside your existing app.post(...) ASSN handler, near the top:
try {
  await axios.post(
    'your-helium-webhook-url-here',
    req.body,
    {
      headers: { 'Content-Type': 'application/json' },
      timeout: 5000
    }
  );
} catch (error) {
  console.error('Failed to forward webhook to Helium:', error.message);
}
```

```javascript Next.js theme={null}
// Inside your existing POST handler, right after you read the body:
// App Router:   const body = await request.json();
// Pages Router: const body = req.body;
try {
  const response = await fetch(
    'your-helium-webhook-url-here',
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(body),
      signal: AbortSignal.timeout(5000)
    }
  );
  if (!response.ok) {
    console.error(`Failed to forward webhook to Helium: status ${response.status}`);
  }
} catch (error) {
  console.error('Failed to forward webhook to Helium:', error);
}
```

```go Go theme={null}
// Inside your existing handler, after reading the request body into `body`
// (a []byte holding the raw JSON payload), near the top:
func() {
	ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second)
	defer cancel()

	req, err := http.NewRequestWithContext(ctx, http.MethodPost,
		"your-helium-webhook-url-here", bytes.NewReader(body))
	if err != nil {
		log.Printf("Failed to forward webhook to Helium: %v", err)
		return
	}
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Printf("Failed to forward webhook to Helium: %v", err)
		return
	}
	defer resp.Body.Close()

	if resp.StatusCode >= 300 {
		log.Printf("Failed to forward webhook to Helium: status %d", resp.StatusCode)
	}
}()
```

```python Python w/ Flask theme={null}
# Inside your existing route, near the top:
try:
    response = requests.post(
        'your-helium-webhook-url-here',
        json=request.json,
        headers={'Content-Type': 'application/json'},
        timeout=5
    )
    response.raise_for_status()
except requests.exceptions.RequestException as e:
    print(f'Failed to forward webhook to Helium: {e}')
```

```python Python w/ FastAPI theme={null}
# Inside your existing handler, right after you read the body:
# body = await request.json()
try:
    async with httpx.AsyncClient(timeout=5.0) as client:
        response = await client.post(
            'your-helium-webhook-url-here',
            json=body,
            headers={'Content-Type': 'application/json'}
        )
        response.raise_for_status()
except httpx.HTTPError as e:
    print(f'Failed to forward webhook to Helium: {e}')
```

## Configure Android

Choose ONE of the following 2 options:

### 1) Google Play RTDN

> [!TIP]
>
> This option is recommended if you are NOT using RevenueCat to handle your purchases.

Utilize Google Play Real-Time Developer Notifications to send revenue events to Helium.

### 2) RevenueCat Webhooks

> [!TIP]
>
> This option is recommended if you are using RevenueCat to handle your purchases.

Use RevenueCat webhooks to send revenue events to Helium. Follow the instructions shown under **RevenueCat Webhooks**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.