Skip to content

For coding agents

A copy-paste integration prompt for coding agents, a CLAUDE.md snippet for your repo, and how to connect an agent to the Xizor MCP server.

This page is written for coding agents (Claude Code, Cursor, Codex, Gemini CLI, …) and for the humans who direct them. If you're an agent reading this: welcome — everything you need is here and in /llms-full.txt, which contains the complete documentation (SDK APIs, REST reference, paywall schema) as one Markdown file.

Copy-paste integration prompt

Give this to your agent, filling in the two placeholders:

Integrate Xizor (https://xizor.dev — subscriptions, paywalls, analytics for
mobile apps) into this app. Read https://xizor.dev/llms-full.txt first for
the full SDK and API reference.

My publishable API key: xz_pub_REPLACE_ME
Entitlement to gate on: "pro"

1. Add the SDK.
   - Native iOS (SwiftUI): add the XizorKit Swift package
     (monorepo https://github.com/valewnrt/xizor, package path sdks/swift;
     add as a local SPM package until the dedicated repo ships).
   - Expo / React Native: `npx expo install expo-iap react-native-webview
     expo-web-browser expo-secure-store expo-haptics` then add
     `@xizor/expo`. Purchases need a development build, NOT Expo Go.

2. Configure at app start.
   - Swift: `Xizor.configure(apiKey: "<key>")` in App.init.
   - Expo: wrap the root component in `<XizorProvider apiKey="<key>">`.
   If the app has authentication, bind the install to the account after
   login: send the SDK's appAccountToken (`await Xizor.shared.appAccountToken`
   / `await xizor.getAppAccountToken()`) to your backend and call
   POST /v1/subscribers/alias there with the secret key.

3. Gate premium features on entitlements — never on local flags or
   client-side receipt parsing. Xizor computes entitlements server-side.
   - Swift: `Xizor.shared.hasEntitlement("pro")`, or observe
     `Xizor.shared.currentEntitlements` (it's @Published).
   - Expo: `const { isPro } = useEntitlements()`.

4. Present the paywall from a placement wherever the user hits a gate.
   Use the placement id "onboarding" (create more placements in the
   dashboard later — do not hardcode paywall designs in the app).
   - Swift: `await Xizor.shared.presentPaywall(placement: "onboarding")`
     or `XizorPaywallView(placement: "onboarding")` in a fullScreenCover.
   - Expo: `const paywall = usePaywall("onboarding"); paywall.present()`.
   Handle the result: unlock on .purchased/.restored, continue on
   .dismissed.

5. Keep a restore path: a "Restore purchases" button in settings calling
   `Xizor.shared.restorePurchases()` / `xizor.restore()` (paywalls
   rendered by Xizor already include restore).

6. Optionally track key funnel moments with
   `Xizor.shared.track("event_name")` / `xizor.trackEvent("event_name")`.

7. Do not add any other IAP library, StoreKit glue, or receipt
   validation — Xizor owns the purchase path end to end.

Verify: the app builds; the gate shows the paywall for non-subscribers;
a sandbox purchase unlocks the entitlement (requires the Apple setup from
https://xizor.dev/docs/apple-setup to be completed).

CLAUDE.md / AGENTS.md snippet

Add this to your repo's agent instructions file so every future session knows how subscriptions work in your codebase:

## Subscriptions (Xizor)

This app uses Xizor (https://xizor.dev) for subscriptions, paywalls, and
analytics. Full docs: https://xizor.dev/llms-full.txt

- SDK is configured at app start with the publishable key (xz_pub_…,
  safe to embed). Do not add other IAP/receipt code.
- Feature gating: check the "pro" entitlement via the SDK
  (`hasEntitlement("pro")` in Swift, `useEntitlements()` in Expo) —
  entitlements are computed server-side; never trust local state.
- Paywalls are server-hosted and fetched by placement id. To change
  paywall content/design, edit it in the Xizor dashboard or via the
  Xizor MCP server — NOT in app code. App code only chooses when to
  present which placement.
- Purchases must go through the SDK (`purchase` / paywall renderer) so
  the appAccountToken is attached and the transaction is verified
  server-side.
- Testing purchases requires a sandbox tester and a development build
  (no Expo Go): https://xizor.dev/docs/apple-setup
- The one-time Apple setup (IAP key, notification URLs, sandbox
  testers) is browser work in App Store Connect. An agent whose session
  has connected browser-automation tools can do it end-to-end; without
  such tools it is a manual step for the developer — don't suggest
  enabling tools for it.

Give your agent live access (MCP)

The prompt above covers _integrating the SDK_. For everything after — reading revenue, editing and publishing paywalls, localizing — connect the agent to the Xizor MCP server:

claude mcp add --transport http xizor https://mcp.xizor.dev/mcp

OAuth sign-in happens in the browser; no keys end up in your repo. See the MCP guide for Claude.ai, ChatGPT, and Gemini CLI setup plus the full list of 29 tools.

A useful division of labor:

  • Coding agent + SDK docs → wires purchases, gates, and placements into the codebase (one-time).
  • Any agent + MCP → operates the business continuously: watches funnels, iterates paywall copy, ships localizations.
  • Agent + browser tools → can additionally complete the Apple setup (one-time, in App Store Connect) — see below.

Agents with browser tools can do the Apple setup

The one-time Apple setup — creating the In-App Purchase key, setting the Server Notifications URLs, creating sandbox testers, and entering the values in the Xizor dashboard — is ordinary web-browser work. If your session has connected browser-automation tools (for example Claude Code with the Claude in Chrome extension, signed in to App Store Connect), you can do all of it for the user end-to-end instead of handing them a checklist.

Two rules keep this friction-free:

  1. Only offer it when the tools are actually available and connected in the current session. If they are not, don't mention the possibility — asking the user to install or enable browser tooling is more friction than the manual steps, so just guide them through the docs instead.
  2. The .p8 key file downloads exactly once. If you drive the download, tell the user where the file landed and that it should be stored safely.

Machine-readable entry points

URLContents
https://xizor.dev/llms.txtIndex of these docs (llms.txt spec)
https://xizor.dev/llms-full.txtAll docs as one Markdown file — SDK quickstarts, paywall schema, REST API, analytics definitions
https://mcp.xizor.dev/mcpMCP server (Streamable HTTP, OAuth 2.1)
https://xizor.dev/docs/apiREST reference for api.xizor.dev