---
title: "Integrate Adapty into your iOS app with AI assistance"
description: "A step-by-step guide to integrating Adapty into your iOS app using Cursor, Context7, ChatGPT, Claude, or other AI tools."
---

This guide helps you integrate Adapty into your iOS app with the help of an LLM. You'll start by preparing your Adapty dashboard, then work through each implementation stage by sending focused doc links to your LLM. At the end, you'll find best practices for setting up your AI tools with Adapty documentation.

:::tip
Copy this entire page as Markdown and paste it into your LLM to get started — click **Copy for LLM** at the top of the page or open [the .md version](https://adapty.io/docs/adapty-cursor.md). The LLM will use the guide links and checkpoints to walk you through each stage.
:::

## Before you start: dashboard checklist

Adapty requires dashboard configuration before you write any SDK code. Your LLM cannot look up dashboard values for you — you'll need to provide them.

### Required before coding

1. **Connect your app store**: In the Adapty Dashboard, go to **App settings → General**. This is required for purchases to work.
   [Connect App Store](integrate-payments.md)

2. **Copy your Public SDK key**: In the Adapty Dashboard, go to **App settings → General**, then find the **API keys** section. In code, this is the string you pass to `Adapty.activate("YOUR_PUBLIC_SDK_KEY")`.

3. **Create at least one product**: In the Adapty Dashboard, go to the **Products** page. You don't reference products directly in code — Adapty delivers them through paywalls.
   [Add products](quickstart-products.md)

4. **Create a paywall and a placement**: In the Adapty Dashboard, create a paywall on the **Paywalls** page, then assign it to a placement on the **Placements** page. In code, the placement ID is the string you pass to `Adapty.getPaywall("YOUR_PLACEMENT_ID")`.
   [Create paywall](quickstart-paywalls.md)

5. **Set up access levels**: In the Adapty Dashboard, configure per product on the **Products** page. In code, the string checked in `profile.accessLevels["premium"]`. The default `premium` access level works for most apps. If paying users get access to different features depending on the product (for example, a `basic` plan vs. a `pro` plan), [create additional access levels](assigning-access-level-to-a-product.md) before you start coding.

:::tip
Once you have all five, you're ready to write code. Tell your LLM: "My Public SDK key is X, my placement ID is Y" so it can generate correct initialization and paywall-fetching code.
:::

### Set up when ready

These are not required to start coding, but you'll want them as your integration matures:

- **A/B tests**: Configure on the **Placements** page. No code change needed.
  [A/B tests](ab-tests.md)
- **Additional paywalls and placements**: Add more `getPaywall` calls with different placement IDs.
- **Analytics integrations**: Configure on the **Integrations** page. Setup varies by integration. See [analytics integrations](analytics-integration.md) and [attribution integrations](attribution-integration.md).

## Feed Adapty docs to your LLM

### Use Context7 (recommended)

[Context7](https://context7.com) is an MCP server that gives your LLM direct access to up-to-date Adapty documentation. Your LLM fetches the right docs automatically based on what you ask — no manual URL pasting needed.

Context7 works with **Cursor**, **Claude Code**, **Windsurf**, and other MCP-compatible tools. To set it up, run:

```
npx ctx7 setup
```

This detects your editor and configures the Context7 server. For manual setup, see the [Context7 GitHub repository](https://github.com/upstash/context7).

Once configured, reference the Adapty library in your prompts:

```
Use the adaptyteam/adapty-docs library to look up how to install the iOS SDK
```

:::warning
Even though Context7 removes the need to paste doc links manually, the implementation order matters. Follow the [implementation walkthrough](#implementation-walkthrough) below step by step to make sure everything works.
:::

### Use plain text docs

You can access any Adapty doc as plain text Markdown. Add `.md` to the end of its URL, or click **Copy for LLM** under the article title. For example: [adapty-cursor.md](https://adapty.io/docs/adapty-cursor.md).

Each stage in the [implementation walkthrough](#implementation-walkthrough) below includes a "Send this to your LLM" block with `.md` links to paste.

For more documentation at once, see [index files and platform-specific subsets](#plain-text-doc-index-files) below.

## Implementation walkthrough

The rest of this guide walks through Adapty integration in implementation order. Each stage includes the docs to send to your LLM, what you should see when done, and common issues.

### Plan your integration

Before jumping into code, ask your LLM to analyze your project and create an implementation plan. If your AI tool supports a planning mode (like Cursor's or Claude Code's plan mode), use it so the LLM can read both your project structure and the Adapty docs before writing any code.

Tell your LLM which approach you use for purchases — this affects the guides it should follow:

- [**Adapty Paywall Builder**](adapty-paywall-builder.md): You create paywalls in Adapty's no-code builder, and the SDK renders them automatically.
- [**Manually created paywalls**](making-purchases.md): You build your own paywall UI in code but still use Adapty to fetch products and handle purchases.
- [**Observer mode**](observer-vs-full-mode.md): You keep your existing purchase infrastructure and use Adapty only for analytics and integrations.

Not sure which one to pick? Read the [comparison table in the quickstart](ios-quickstart-paywalls.md).

### Install and configure the SDK

Install the Adapty SDK package via Swift Package Manager in Xcode and activate it with your Public SDK key. This is the foundation — nothing else works without it.

**Guide:** [Install & configure Adapty SDK](sdk-installation-ios.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/sdk-installation-ios.md
```

:::tip[Checkpoint]
- **Expected:** App builds and runs. Xcode console shows Adapty activation log.
- **Gotcha:** "Public API key is missing" → check you replaced the placeholder with your real key from App settings.
:::

### Show paywalls and handle purchases

Fetch a paywall by placement ID, display it, and handle purchase events. The guides you need depend on how you handle purchases.

Test each purchase in the sandbox as you go — don't wait until the end. See [Test purchases in sandbox](test-purchases-in-sandbox.md) for setup instructions.

<Tabs groupId="paywall-approach">

<TabItem value="builder" label="Paywall Builder" default>

**Guides:**
- [Enable purchases using paywalls (quickstart)](ios-quickstart-paywalls.md)
- [Fetch Paywall Builder paywalls and their configuration](get-pb-paywalls.md)
- [Display paywalls](ios-present-paywalls.md)
- [Handle paywall events](ios-handling-events.md)
- [Respond to button actions](handle-paywall-actions.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-quickstart-paywalls.md
- https://adapty.io/docs/get-pb-paywalls.md
- https://adapty.io/docs/ios-present-paywalls.md
- https://adapty.io/docs/ios-handling-events.md
- https://adapty.io/docs/handle-paywall-actions.md
```

:::tip[Checkpoint]
- **Expected:** Paywall appears with your configured products. Tapping a product triggers the sandbox purchase dialog.
- **Gotcha:** Empty paywall or `getPaywall` error → verify placement ID matches the dashboard exactly and the placement has an audience assigned.
:::

</TabItem>

<TabItem value="manual" label="Manual paywalls">

**Guides:**
- [Enable purchases in your custom paywall (quickstart)](ios-quickstart-manual.md)
- [Fetch paywalls and products](fetch-paywalls-and-products.md)
- [Render paywall designed by remote config](present-remote-config-paywalls.md)
- [Make purchases](making-purchases.md)
- [Restore purchases](restore-purchase.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-quickstart-manual.md
- https://adapty.io/docs/fetch-paywalls-and-products.md
- https://adapty.io/docs/present-remote-config-paywalls.md
- https://adapty.io/docs/making-purchases.md
- https://adapty.io/docs/restore-purchase.md
```

:::tip[Checkpoint]
- **Expected:** Your custom paywall displays products fetched from Adapty. Tapping a product triggers the sandbox purchase dialog.
- **Gotcha:** Empty products array → verify the paywall has products assigned in the dashboard and the placement has an audience.
:::

</TabItem>

<TabItem value="observer" label="Observer mode">

**Guides:**
- [Observer mode overview](observer-vs-full-mode.md)
- [Implement Observer mode](implement-observer-mode.md)
- [Report transactions in Observer mode](report-transactions-observer-mode.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/observer-vs-full-mode.md
- https://adapty.io/docs/implement-observer-mode.md
- https://adapty.io/docs/report-transactions-observer-mode.md
```

:::tip[Checkpoint]
- **Expected:** After a sandbox purchase using your existing purchase flow, the transaction appears in the Adapty dashboard **Event Feed**.
- **Gotcha:** No events → verify you're reporting transactions to Adapty and App Store Server Notifications are configured.
:::

</TabItem>

</Tabs>

### Check subscription status

After a purchase, check the user profile for an active access level to gate premium content.

**Guide:** [Check subscription status](ios-check-subscription-status.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-check-subscription-status.md
```

:::tip[Checkpoint]
- **Expected:** After a sandbox purchase, `profile.accessLevels["premium"]?.isActive` returns `true`.
- **Gotcha:** Empty `accessLevels` after purchase → check the product has an access level assigned in the dashboard.
:::

### Identify users

Link your app user accounts to Adapty profiles so purchases persist across devices.

:::important
Skip this step if your app has no authentication.
:::

**Guide:** [Identify users](ios-quickstart-identify.md)

Send this to your LLM:
```
Read these Adapty docs before writing code:
- https://adapty.io/docs/ios-quickstart-identify.md
```

:::tip[Checkpoint]
- **Expected:** After calling `Adapty.identify("your-user-id")`, the dashboard **Profiles** section shows your custom user ID.
- **Gotcha:** Call `identify` after activation but before fetching paywalls to avoid anonymous profile attribution.
:::

### Prepare for release

Once your integration works in the sandbox, walk through the release checklist to make sure everything is production-ready.

**Guide:** [Release checklist](release-checklist.md)

Send this to your LLM:
```
Read these Adapty docs before releasing:
- https://adapty.io/docs/release-checklist.md
```

:::tip[Checkpoint]
- **Expected:** All checklist items confirmed: store connection, server notifications, purchase flow, access level checks, and privacy requirements.
- **Gotcha:** Missing App Store Server Notifications → configure them in **App settings → iOS SDK** or events won't appear in the dashboard.
:::

## Plain text doc index files

If you need to give your LLM broader context beyond individual pages, we host index files that list or combine all Adapty documentation:

- [`llms.txt`](https://adapty.io/docs/llms.txt): Lists all pages with `.md` links. An [emerging standard](https://llmstxt.org/) for making websites accessible to LLMs. Note that for some AI agents (e.g., ChatGPT) you will need to download `llms.txt` and upload it to the chat as a file.
- [`llms-full.txt`](https://adapty.io/docs/llms-full.txt): The entire Adapty documentation site combined into a single file. Very large — use only when you need the full picture.
- iOS-specific [`ios-llms.txt`](https://adapty.io/docs/ios-llms.txt) and [`ios-llms-full.txt`](https://adapty.io/docs/ios-llms-full.txt): Platform-specific subsets that save tokens compared to the full site.