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):
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 /healthUse 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
APP_NAME="YourApp" BUNDLE_ID="com.you.app" CODE="YOURCODE" \
API_BASE_URL="https://<your-api>" pnpm --filter @maa/api onboardPrints (once): appId, SDK key, RevenueCat webhook URL + Authorization secret, and your referral code.
3. Integrate the SDK
See SDKs (e.g. iOS): configure → applyCode / attribute(url:) →
identify → RevenueCat affiliate_id pass-through. Web SaaS product? Follow the
Web SaaS guide instead.
4. Configure RevenueCat
See Webhooks: set the webhook URL + Authorization secret, and make sure
logIn uses the same user id as identify.
5. Branded links (optional — needs Apple setup)
To make …/<appId>/<code> links attribute automatically:
- Deploy the link Worker (
apps/links,wrangler deploy); setLINKS_API_BASE_URLandAPPLE_APP_ID(TEAMID.bundleid). - Host the AASA (the Worker serves
/.well-known/apple-app-site-association). - Add the Associated Domains capability in Xcode:
applinks:<your-link-domain>. - Handle the URL with
AffiliateSDK.attribute(url:).
The referral-code path needs none of this and works immediately.
6. Verify
Make a sandbox purchase → RevenueCat webhook fires → a commission appears on the
dashboard. Or rehearse without a device: pnpm --filter @maa/api smoke.