# Set up with an AI coding agent

> Let Cursor, Claude Code, GitHub Copilot, or another coding agent add Sharklio to your project, from a ready-made prompt and docs written for agents.

Source: https://docs.sharklio.com/ai-agent-setup

## Start from the prompt in your dashboard

1. Open your dashboard, Apps, your app, Integration, and click **Set up with your coding agent**.
2. Choose what you are building: Offerwall, Offers API, or Mobile SDK. For the Mobile SDK, also choose Android, iOS, Flutter, React Native, or Unity. You can pick your server language too: PHP, Node.js, or Python.
3. Click **Copy prompt**, or **Download .md**, and give it to your coding agent in your project.

The prompt is built for your app the moment you open it, so it always matches your settings and the current docs:

| Part | What it has |
| --- | --- |
| Rules | Inspect the project first, ask one question at a time, never ask for or print a key, and credit rewards only from checked postbacks. |
| My app | Your app name and App ID, your currency, conversion rate, user split, and rounding, the link hash check, and your postback URL with any values that are not macros hidden. |
| The integration | The steps and code for the offerwall link, the Offers API, or the SDK you chose. |
| Postbacks | How to check the hash and credit or take back rewards, with test values for the hash. |
| Test it | The checks in Integration status, step by step. |
| Docs | Links to the Markdown pages the agent needs. |

## Your keys stay with you

The prompt never contains a key, and it tells the agent never to ask for one. The code reads the keys from environment variables, which you set on your server or in the secret settings of your host:

| Variable | Value | Used for |
| --- | --- | --- |
| `SHARKLIO_LINK_SALT` | Link hash salt | Signing offerwall links |
| `SHARKLIO_POSTBACK_KEY` | Postback secret key | Checking every postback |
| `SHARKLIO_API_KEY` | API key | The Offers API, the Reporting API, and mobile SDK sessions |

You find all three on the Integration tab of your app. Never paste them into a chat with an agent.

## Docs written for agents

- [llms.txt](https://docs.sharklio.com/llms.txt): an index of every docs page with a one-line summary, the starting point for an agent.
- Every page as Markdown: add `.md` to its URL, for example [postbacks.md](https://docs.sharklio.com/postbacks.md). The quick start is [index.md](https://docs.sharklio.com/index.md). Every page also has a View as Markdown link at the top.
- [openapi.json](https://docs.sharklio.com/openapi.json): every API endpoint with its parameters and responses, and the postback.

All of them are built from the pages you read here, so they are always up to date.

## Instructions for coding agents

If you are an AI agent setting up Sharklio, follow these rules:

- Inspect the project first: the framework, the server language, how users sign in, and how balances are stored. Tell the user what you found before you change anything.
- If something is unclear, ask one question at a time.
- Never ask for a key and never print one in chat, code, logs, or commits. Read the keys from the environment variables above.
- Build offerwall links, mobile SDK sessions, and Offers API requests on the server. Never put a key in browser code, HTML, or a mobile app.
- Credit a reward only from a postback that passed the hash check, and only once for each `transaction_id`. On status 2, take the reward back once. Answer with HTTP 200.
- Rewards arrive already in the app currency. Never convert them again.
- Show the user each change to an existing file before you make it.
- Finish with the checks in [Testing](https://docs.sharklio.com/testing), then report which files you changed and what you tested.

## Test the result

Integration status on the Integration tab checks the work without real traffic: Check a link, Open as a test user, and Send a test postback. Test from a normal home or mobile connection. Through a VPN, a proxy, or a cloud machine, including the one your agent may run on, the offerwall shows a block page instead of offers. See [Testing](https://docs.sharklio.com/testing).
