> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Scaffold an app from your editor

> Give your editor the Fanvue docs, OpenAPI specs and SDK, then generate a working app from the App Starter with one request.

By the end of this page your editor will have generated a Fanvue app from the [Fanvue App Starter](https://github.com/fanvue/fanvue-app-starter), a Next.js and pnpm template with OAuth preconfigured, and you'll have signed in to it with Fanvue. The generated code starts from working sign-in instead of building it.

You need:

* an editor that can read URLs into its context, rules file or docs settings
* pnpm
* a Fanvue account that can create an app in the Developer Area; [Build your first app](/docs/get-started/build-your-first-app) covers registering one

<Steps>
  <Step title="Point your editor at the docs">
    Add these URLs to your editor's context, rules file or docs settings. Each is plain text or JSON, so any tool that reads URLs can use it.

    | File | URL |
    | - | - |
    | Docs index | `https://api.fanvue.com/docs/llms.txt` |
    | Full docs | `https://api.fanvue.com/docs/llms-full.txt` |
    | OpenAPI, unversioned API | `https://api.fanvue.com/docs/openapi.json` |
    | OpenAPI, `/v1/` API | `https://api.fanvue.com/docs/openapi-v1.json` |

    [Docs as plain text](/docs/integrations/docs-as-plain-text) describes what each file holds.
  </Step>

  <Step title="Install the SDK">
    The SDK gives the generated code typed OAuth handlers and an API client, so the editor does not write them from scratch.

    ```bash theme={null}
    pnpm add @fanvue/builder-sdk
    ```

    Name the entrypoint for your app type in the request:

    | App type | Entrypoint |
    | - | - |
    | Off-platform (sign in with Fanvue on your own site) | `@fanvue/builder-sdk/nextjs/off-platform` |
    | On-platform (runs inside Fanvue) | `@fanvue/builder-sdk/nextjs/embedded-app` |
    | API-only (no sign-in surface) | `@fanvue/builder-sdk` |

    [Choose your app type](/docs/get-started/choose-your-app-type) explains the three.
  </Step>

  <Step title="Send the request">
    Paste this into your editor verbatim, then fill in the build description on the last line:

    ```text wrap theme={null}
    Build an app on the Fanvue API. Before writing any code:
    1. Read https://api.fanvue.com/docs/llms-full.txt for OAuth setup, scopes and the
       API conventions, and follow them.
    2. Start from the Fanvue App Starter: https://github.com/fanvue/fanvue-app-starter
    3. Use pnpm for all install, dev and build commands (required).
    4. Use @fanvue/builder-sdk/nextjs/off-platform for sign-in. Authenticate with
       OAuth 2.0 and request only the scopes the app needs, plus the system scopes
       openid, offline_access and offline.
    5. Send X-Fanvue-API-Version: 2025-06-26 on every request.
    6. Use /v1/ endpoints with cursor pagination, or page and size on the unversioned
       API. Treat timestamps as UTC and amounts as USD cents.
    7. If building for an agency, use the creator-scoped endpoints and group results by
       creatorUuid.
    Then build: [describe what you want here].
    ```

    For an on-platform or API-only app, swap the entrypoint in item 4 of the request for the one in the table.
  </Step>

  <Step title="Run and sign in">
    Create an app in the Developer Area and copy the Client ID and Client Secret from its **Authentication** tab into the generated `.env`. Set `OAUTH_REDIRECT_URI` to the callback route the generated app serves, and add the same URI to the app's redirect URIs on the **Authentication** tab. `SESSION_SECRET` must be a random string of at least 32 characters.

    ```ini .env theme={null}
    OAUTH_CLIENT_ID=your-client-id
    OAUTH_CLIENT_SECRET=your-client-secret
    OAUTH_REDIRECT_URI=<the callback route the generated app serves>
    SESSION_SECRET=<random string of at least 32 characters>
    ```

    Then run the app and sign in with Fanvue. [Sign in with Fanvue](/docs/get-started/sign-in-with-fanvue) walks through the OAuth flow the generated code runs.
  </Step>
</Steps>

## Next steps

To call endpoints from the editor while you build, connect the [Fanvue MCP server](/docs/mcp-server) as well. It authorises through the same OAuth flow and exposes the unversioned API as tools. The [Builder SDK overview](/docs/app-store/sdk/overview) covers the rest of the package the generated code imports.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.