> For the complete documentation index, see [llms.txt](https://docs.lighter.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lighter.xyz/developers/getting-started/choose-your-integration.md).

# Choose your integration

Pick the integration pattern that fits your product before writing any code.

Most integrations are one of four patterns. They differ in **who holds the keys** and **who signs transactions**.

| Pattern                               | Who owns the Lighter account | Who signs trades                                   | Typical product                           |
| ------------------------------------- | ---------------------------- | -------------------------------------------------- | ----------------------------------------- |
| **A. Self-custodial frontend**        | End user (their L1 wallet)   | End user's API key, generated in their browser/app | Wallets, trading UIs, super-apps          |
| **B. Server-side on behalf of users** | End user                     | Your backend, with an API key the user approved    | Copy trading, managed strategies, agents  |
| **C. Your own account**               | You                          | Your backend                                       | Market makers, bots, funds                |
| **D. Read-only**                      | –                            | Nobody (no signing)                                | Dashboards, analytics, portfolio trackers |

## A. Self-custodial frontend (most wallets and apps)

1. User connects their Ethereum wallet (the **L1 address**).
2. User deposits → Lighter creates an **account index** for them. See [Deposits, Transfers and Withdrawals](/developers/integration-guides/deposits-transfers-and-withdrawals.md).
3. Your app generates an **API key pair locally** (WASM `GenerateAPIKey`), then the user signs a one-time `ChangePubKey` with their wallet to register it. See [Create accounts programmatically](/developers/integration-guides/create-accounts-programmatically.md).
4. From then on your app signs orders locally with that API key – no wallet pop-ups per trade.
5. Optionally, the user approves you as an **integrator** so you earn a fee on their trades. See [Partner Attribution](/developers/integration-guides/partner-attribution.md).

The API private key never leaves the user's device.

## B. Server-side on behalf of users

Same as A, but the API key used for trading lives on your server. The user still registers the key with a one-time L1 signature. Treat these keys as highly sensitive: an API key can trade and can request **secure withdrawals** (which only go back to the user's own L1 address).

## C. Your own account

Create an account by depositing, register API keys, sign and send from your backend. Consider the **Premium/Advanced** tier for low latency and higher limits. See [Account Types](/developers/reference/account-types.md).

## D. Read-only

No keys needed for public market data. For a specific account's private data use a **read-only auth token** (valid up to 10 years). See [API keys](/developers/integration-guides/api-keys.md#read-only-authentication).

## Checklist of what you'll need

| Need                                              | Self-custodial frontend | Server-side for users | Your own account | Read-only       |
| ------------------------------------------------- | ----------------------- | --------------------- | ---------------- | --------------- |
| WASM (or Go/Python) signer                        | ✅                       | ✅                     | ✅                | –               |
| User's L1 signature (once per API key)            | ✅                       | ✅                     | –                | –               |
| Builder API key for `bridge.lighter.xyz` deposits | optional                | optional              | –                | –               |
| Plus or Premium/Advanced tier (for partner fees)  | if charging fees        | if charging fees      | optional         | –               |
| Auth token                                        | for private data        | for private data      | for private data | read-only token |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lighter.xyz/developers/getting-started/choose-your-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
