---
title: "MyAppAffiliate"
source: https://docs.myappaffiliate.com
docs: "MyAppAffiliate — Developer Documentation"
index: https://docs.myappaffiliate.com/llms.txt
---
# MyAppAffiliate

Partner attribution for subscription products — mobile apps **and** web SaaS. Track
which creators drive installs, signups, subscriptions, and recurring revenue — then pay
them.

## The loop

```
affiliate link / code
   → click / landing    (link service, or ?via= on your site)
   → install / signup   (SDK records attribution on first touch)
   → identify user      (SDK binds your user id)
   → subscription       (your billing provider's webhook → our API)
   → commission         (attribution engine, incl. renewals)
   → CSV payout         (mature → export → marked paid)
   → dashboard          (founder + creator views)
```

## Two calls, on every platform

```
start(apiKey)        → once at launch
identify(userId)     → once you know who the user is
```

That is the entire required integration. `start` takes your key and nothing else —
**the API host is compiled into every SDK**, so no URL is ever typed into your code.
Capturing the link, retrying an offline first launch, and asking for a deferred match
on a fresh install all happen inside it.

| Platform | Guide |
|---|---|
| iOS (Swift) | [/sdk-ios](https://docs.myappaffiliate.com/sdk-ios) |
| Android (Kotlin) | [/sdk-android](https://docs.myappaffiliate.com/sdk-android) |
| React Native | [/sdk-react-native](https://docs.myappaffiliate.com/sdk-react-native) |
| Flutter | [/sdk-flutter](https://docs.myappaffiliate.com/sdk-flutter) |
| Web (browser) | [/sdk-web](https://docs.myappaffiliate.com/sdk-web) |
| Node (server) | [/sdk-node](https://docs.myappaffiliate.com/sdk-node) |

See the [SDK index](https://docs.myappaffiliate.com/sdk) for the optional calls.

## Quickstart — mobile app

**Prompt for an AI coding agent**

```text
Integrate MyAppAffiliate into my project.

Documentation (read these first, they are the source of truth):
- Page: https://docs.myappaffiliate.com/index.md
- Full docs index: https://docs.myappaffiliate.com/llms.txt

Task: Integrate MyAppAffiliate into my mobile app: install and start the SDK for my platform with just the API key, identify the user with the same id my billing provider reports, and point my billing provider's webhook at MyAppAffiliate.

Rules:
- Follow the documented API exactly — no invented method names, endpoints, parameters or field names.
- Match the conventions already used in my codebase.
- Ask me for my SDK key instead of guessing, and never hard-code it — read it from config/environment.
- Do NOT set an API base URL anywhere. Every SDK compiles the production host in; a staging or self-hosted host belongs in a build setting, not in code.
- Tell me afterwards which steps I still have to do by hand (dashboard settings, capabilities, webhook configuration).
```

**1. Start the SDK** (iOS shown; every platform is the same shape):

```swift
import MyAppAffiliate

MyAppAffiliate.start(apiKey: "pk_live_…")
// SwiftUI: ContentView().myAppAffiliate(apiKey: "pk_live_…") also handles links
```

**2. Identify the user** — the same id your billing provider reports back to us:

```swift
MyAppAffiliate.identify(userId: yourUserId)
```

**3. Point your billing provider's webhook** at
`https://api.myappaffiliate.com/webhooks/<provider>/<appId>` with the secret from
onboarding. `<provider>` is `revenuecat`, `adapty`, `superwall`, `stripe` or `paddle`.

Subscriptions now turn into commissions on the dashboard. Renewals included.

## Quickstart — web SaaS

**Prompt for an AI coding agent**

```text
Integrate MyAppAffiliate into my project.

Documentation (read these first, they are the source of truth):
- Page: https://docs.myappaffiliate.com/index.md
- Full docs index: https://docs.myappaffiliate.com/llms.txt

Task: Integrate MyAppAffiliate into my web SaaS: drop in the Web SDK so it captures ?via= referral codes, identify the user at signup, carry that user id into my billing provider's checkout, and add the revenue webhook.

Rules:
- Follow the documented API exactly — no invented method names, endpoints, parameters or field names.
- Match the conventions already used in my codebase.
- Ask me for my SDK key instead of guessing, and never hard-code it — read it from config/environment.
- Do NOT set an API base URL anywhere. Every SDK compiles the production host in; a staging or self-hosted host belongs in a build setting, not in code.
- Tell me afterwards which steps I still have to do by hand (dashboard settings, capabilities, webhook configuration).
```

**1. Start the Web SDK** — it auto-captures `?via=CODE`, on every route:

```ts
import { myAppAffiliate } from "@myappaffiliate/sdk-web";

myAppAffiliate.start("pk_live_…");
```

**2. Identify at signup**, **3. carry that id into checkout**, and **4. add the
webhook** — the whole flow, for Stripe and Paddle, is in the
[Web SaaS guide](https://docs.myappaffiliate.com/web-saas).

## The one thing to get right

Attribution joins on **your user id**. The string you pass to `identify(userId)` must
be the string that arrives in the revenue event — RevenueCat's `app_user_id`, Adapty's
customer user id, Superwall's app user id, Stripe's `metadata.customer_user_id`,
Paddle's custom data. If they differ, everything looks healthy and no commission is
ever created. [Billing & Webhooks](https://docs.myappaffiliate.com/webhooks) has the field for each provider.

## Where next

- [SDKs](https://docs.myappaffiliate.com/sdk) — iOS, Android, React Native, Flutter, Web, Node
- [API Reference](https://docs.myappaffiliate.com/api) — REST endpoints
- [Billing & Webhooks](https://docs.myappaffiliate.com/webhooks) — RevenueCat, Adapty, Superwall, Stripe, Paddle
- [Web SaaS guide](https://docs.myappaffiliate.com/web-saas) — end-to-end for web products
- [MCP Server](https://docs.myappaffiliate.com/mcp) — run your creator program from Claude Code or Cursor
- [Dashboard Guide](https://docs.myappaffiliate.com/dashboard) — founder + creator views, CSV payouts
- [Go-Live & Deploy](https://docs.myappaffiliate.com/go-live) — onboard your app and ship it
