---
title: "Go-Live & Deploy"
source: https://docs.myappaffiliate.com/go-live
docs: "MyAppAffiliate — Developer Documentation"
index: https://docs.myappaffiliate.com/llms.txt
---
# Go-Live & Deploy

From zero to tracking a real app.

## 1. Deploy the API (public HTTPS)

The API ships with a Dockerfile + `fly.toml` + `render.yaml`. Fly (no GitHub needed):

```bash
cd .
brew install flyctl && fly auth login
fly launch --no-deploy
fly secrets set DATABASE_URL="<pooled Neon URL>" API_CORS_ORIGINS="*"
fly deploy && fly open /health
```

Use the **pooled** Neon URL (host has `-pooler`) for runtime; migrations run automatically
as the release step. Render/Railway alternatives are in the repo's `docs/18-deployment.md`.

> The prototype API is already live at `https://maa-api-cccf50.fly.dev`.

## 2. Onboard your app

```bash
APP_NAME="YourApp" BUNDLE_ID="com.you.app" CODE="YOURCODE" \
API_BASE_URL="https://<your-api>" pnpm --filter @maa/api onboard
```

Prints (once): **appId**, **SDK key**, a **webhook URL + secret for every supported
billing provider**, and your **referral code**. You only configure the providers you use.

## 3. Integrate the SDK

See [SDKs](https://docs.myappaffiliate.com/sdk) (e.g. [iOS](https://docs.myappaffiliate.com/sdk-ios)) — two calls: `start(apiKey)` then
`identify(userId)`. No API URL goes into your code. Web SaaS product? Follow the
[Web SaaS guide](https://docs.myappaffiliate.com/web-saas) instead.

## 4. Connect your billing provider

See [Billing & Webhooks](https://docs.myappaffiliate.com/webhooks). Register the endpoint for whichever provider bills
your customers — RevenueCat, Adapty, Superwall, Stripe or Paddle — paste its secret,
and make sure the user id it reports is the same string you pass to `identify`.

## 5. Branded links (optional — needs Apple setup)

To make `…/<appId>/<code>` links attribute automatically:

1. Deploy the link Worker (`apps/links`, `wrangler deploy`); set `LINKS_API_BASE_URL` and
   `APPLE_APP_ID` (`TEAMID.bundleid`).
2. Host the AASA (the Worker serves `/.well-known/apple-app-site-association`).
3. Add the **Associated Domains** capability in Xcode: `applinks:<your-link-domain>`.
4. Handle the URL with `MyAppAffiliate.attribute(url:)` — or, in SwiftUI, the
   `.myAppAffiliate(apiKey:)` modifier, which wires it for you.

The **referral-code** path needs none of this and works immediately.

## 6. Verify

Make a sandbox purchase → your provider's webhook fires → a commission appears on the
[dashboard](https://docs.myappaffiliate.com/dashboard). Or rehearse without a device: `pnpm --filter @maa/api smoke`.
