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

# Superwall

> Send Superwall subscription events to Appeeky Analytics so purchases are credited to the install source

If your app sells through Superwall, add one webhook in Superwall and Appeeky Analytics records trials, purchases, renewals and refunds the same way it does for [RevenueCat](https://docs.appeeky.com/docs/analytics-revenue.md): each sale is matched to the install that made it, shows up in revenue by source, LTV and ROAS, and can send a [sale alert](https://docs.appeeky.com/docs/analytics-alerts.md).

***

## Set Up

**1. Get your webhook URL**

In Appeeky, open the app's **Attribution** tab, go to **Setup** and click **Get webhook URL** on the **Superwall** card. The URL is the same for all your apps.

**2. Add it in Superwall**

In the Superwall dashboard, open **Integrations → Webhooks**, add an endpoint and paste the URL.

**3. Save the signing secret**

Superwall shows a signing secret for the endpoint (it starts with `whsec_`). Paste it into the Superwall card and click **Save**. From then on, Appeeky only accepts requests signed with it.

**4. Identify users in the app**

Pass the same user id to Appeeky that you give Superwall:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
Appeeky.identify(userId);
```

The card shows when the last event arrived, how many were forwarded and the last error, if any.

> [!NOTE]
>
> Until the signing secret is saved, the URL alone is accepted. Save the secret to reject requests that Superwall did not sign.

***

## How Events Are Matched

Superwall events carry the subscriber's original app user id. Appeeky looks for an install that was identified with that id and credits the sale to its source, campaign, keyword, country, device and app version. Events without a matching install still count as revenue, with an unknown source.

| Superwall event | Recorded as |
| - | - |
| A purchase with `periodType` `TRIAL` | Trial started |
| A purchase with `isTrialConversion` | Trial converted |
| Other `initial_purchase` and `non_renewing_purchase` events | Purchase |
| Other `renewal` events | Renewal |
| An event with a negative `price` | Refund |

Cancellations, expirations and billing issues are not revenue and are not recorded.

Sandbox events are ignored. Each Superwall event id is recorded once, so retries never count twice.

Events are only forwarded when Analytics is on for at least one of your apps. A failed forward answers with an error, so Superwall retries it.

***

## Rotate the URL

Click **New URL** on the Superwall card to replace the URL, for example if it leaked. Update the endpoint in Superwall right after: the old URL stops working.

***

## Self-hosted Servers

A self-hosted Analytics server takes Superwall webhooks directly at `https://YOUR_SERVER/v1/webhooks/superwall`, checked against its `SUPERWALL_WEBHOOK_SECRET`. See [Self-hosting](https://docs.appeeky.com/docs/analytics-self-hosting.md).

***

## Related Docs

* [Revenue](https://docs.appeeky.com/docs/analytics-revenue.md)
* [Sale Alerts](https://docs.appeeky.com/docs/analytics-alerts.md)
* [Users & Live Activity](https://docs.appeeky.com/docs/analytics-users.md)


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