Browse documentation

Start

Quickstart

Deploy an agent backend, dashboard, chat widget, or Flary Mail to Cloudflare.

1. Choose what you need

You want Choose
A ready personal control panel Personal dashboard
An API for your existing product or bot Agent backend
Your own web or mobile UI Agent backend, then build your UI
A small chat surface in an existing site Agent backend with the generated Web Component
A self-hosted business inbox Flary Mail

The dashboard starter includes first-owner login, the React and WebSocket thread console, provider setup, MCP connections, approvals, tool activity, and secret-health status. The backend is an API service and exposes the same agent runtime through typed APIs.

The mail starter receives and sends mail for selected addresses. It includes inbox, sent, draft, archive, spam, and trash folders; replies and attachments; team access; and WebSocket updates. Mail is an optional starter surface, not a dependency of every agent backend.

2. Hosted installer status

The hosted installer at flary.dev is planned but is not in the current release. Its intended flow is:

  1. Choose Dashboard, Agent Backend, or Flary Mail.
  2. Connect the Cloudflare account that should own the deployment.
  3. Choose Workers AI, a BYOK API key, or a supported subscription connection.
  4. Review the resources and click Deploy.
  5. Open the ready dashboard, API, widget, or inbox.

The installer will use Cloudflare OAuth and deploy into the customer’s account. Use the CLI flow below today.

3. Current CLI setup

npx flary create

The CLI needs Node.js and a package manager. The default setup does not need Docker. Browser Run and Sandbox are optional.

4. Sign in to Cloudflare

The wizard starts Wrangler OAuth. Sign in in the browser and select the Cloudflare account that will own the deployment. Flary stores the selected account ID in .flary/project.json. It never reads or stores Wrangler’s access token.

5. Choose an AI provider

Choose one of these deployment providers:

  • Workers AI: uses the connected Cloudflare account and does not need a provider key.
  • Google Gemini, OpenAI, or Anthropic API: BYOK. Enter the API key in the hidden prompt.
  • No provider: configure a provider later in trusted host code.

After deployment, the personal dashboard can authorize an OpenAI Codex or Anthropic Claude subscription through provider OAuth. This is separate from the deployment key. A model uses that subscription only when the trusted resolver selects the saved connection.

The personal dashboard does not ask for an MCP token. After deployment, open Connections, paste an MCP server URL, and complete the server’s login. For the backend template, the optional GitHub example uses a fine-grained GitHub token during setup.

Local secrets go in .dev.vars with file mode 0600. Production values are uploaded as Worker secrets. They do not enter source files or command arguments.

6. Deploy

The wizard installs packages, builds the Worker, creates required Cloudflare resources, uploads secrets, applies database migrations, deploys, and checks /health. For mail projects, it also enables Email Routing and Email Sending. Email Routing replaces the domain’s MX records. The wizard asks for explicit approval before it makes this change.

If setup stops, continue from the project directory:

npx flary setup
npx flary deploy
npx flary doctor

7. Use the result

For a dashboard, open the printed setup URL and create the first owner with FLARY_SETUP_TOKEN from the generated .dev.vars file. Registration closes after that owner is created. Direct Better Auth registration is disabled. Open Connections to add an MCP server by URL.

For a personal backend, use FLARY_ACCESS_TOKEN from .dev.vars as a bearer token. Existing-application authentication stays closed in production until you add a trusted identity resolver.

For mail, open the printed /setup URL and use FLARY_SETUP_TOKEN to create the first owner. The CLI uses Wrangler OAuth, so it does not need a Flary API key or a separate OAuth client. D1 stores mail state, R2 stores raw mail and attachments, Queues handle parse and send work, and a hibernating Durable Object sends live WebSocket events. The template does not use KV.

For an agent backend with the widget enabled, open /widget to test the demo or embed the Web Component in an existing page:

<flary-chat title="Support assistant"></flary-chat>
<script src="https://YOUR-WORKER.workers.dev/widget.js"></script>

The starter widget uses a temporary visitor identity. Add your application identity, an origin allowlist, rate limits, or Turnstile before you expose it to high-traffic production users. A React application can use FlaryAgentConsole or useFlaryThread() from flary/react.

Next, choose one guide:

Automated CLI setup

Non-interactive setup must state every required choice. Provider keys come from the process environment.

OPENAI_API_KEY=... npx flary create my-flary \
  --template backend \
  --provider openai \
  --package-manager npm \
  --deploy \
  --yes

Create mail without interactive prompts:

npx flary create my-mail \
  --template mail \
  --domain example.com \
  --mailboxes admin,support \
  --package-manager npm \
  --deploy \
  --yes