LeveredDocs

Quick Start

Prototype your variants in the browser first, then wire them up. Zero to a live optimization in four steps.

Zero to a live optimization in four steps. Your coding agent does the work. Copy each prompt below and paste it into Claude Code, Cursor, or any agent that can fetch a URL.

1. Create an account

Sign up at app.levered.dev. It is free and needs no card. Keep the tab open; you'll need it in 4a and 4c.

2. Install Levered

Prompt for your coding agent
Set up Levered in this project. First get the Levered skills: if you are Claude Code, run `claude plugin marketplace add levered-hq/claude-plugin` and then `claude plugin install levered@levered`, and follow the growth-engineer skill it installs. Otherwise, fetch and follow https://raw.githubusercontent.com/levered-hq/claude-plugin/main/skills/growth-engineer/SKILL.md

Install the Levered CLI and log me in.

Approve the install commands when your agent asks. Done when you see Logged in as you@example.com.

Prefer to install the plugin yourself? (Claude Code only)

Type these two commands in Claude Code, then paste the prompt above:

Claude Code
/plugin marketplace add levered-hq/claude-plugin
/plugin install levered@levered

3. Prototype your variants

Nothing touches the platform yet. The variants live in your code behind a local preview switch, so you can click through them in the browser and iterate freely:

Prompt for Claude Code
Using Levered, prototype variants for <the screen or flow you want to optimize>. Read the code, decide what's actually worth varying, and propose the design — copy, layout, imagery, step count, defaults, whatever has the most leverage. Build the variants in my code behind a local preview switch so I can click through every combination in the browser. Don't create anything in Levered yet — I want to iterate on the design first.

Replace <the screen or flow you want to optimize> with e.g. "my sign-up screen" or "the paywall". Don't prescribe what to vary, because the agent sees the code.

Don't know what to optimize yet?
Prompt for Claude Code
Using Levered, find the highest-leverage thing to optimize in this project. Read the code, map the path a user takes to convert, and tell me where you'd expect the biggest win and why. Then prototype variants for it behind a local preview switch so I can click through every combination in the browser. Don't create anything in Levered yet.

Iterate here until you're happy. Once an optimization is live, changing factors or levels means archiving and recreating it.

4. Go live

4a. Connect a warehouse

In the dashboard: Settings > Warehouse > Managed Warehouse. That's it, and this guide assumes the Managed Warehouse.

Conversion data already in BigQuery, Snowflake, or Postgres? Connect that instead and skip the tracking half of 4c.

4b. Create a goal metric

Prompt for Claude Code
Using Levered, create the reward metric for the flow we just prototyped. Work out what conversion those variants are meant to drive, pick a clear event name for it, and create it as a boolean reward metric. Tell me the exact event name you used — I need it for the tracking step.

Note the event name it reports back. The reward events in 4c must match it exactly, or conversions never attribute.

4c. Create the optimization and wire up tracking

Turn the prototype into a real optimization served by the bandit:

Prompt for Claude Code
Using Levered, create the optimization for the variants we prototyped, targeting the reward metric we just created. Then replace the local preview switch with the Levered SDK so variants are served by the bandit, and remove the preview scaffolding.

Create an API key for event ingestion: go to app.levered.dev/warehouse, click Create key, and copy the secret, because it's shown once. Export it in your shell and your app's environment:

Terminal
export LEVERED_API_KEY=<your-api-key>

Then wire up the tracking: an exposure when a user sees a variant, a reward when they convert:

Prompt for Claude Code
Using Levered, add event tracking to my app via the managed-warehouse ingestion API: POST an exposure to /api/v2/ingest/exposures when a user is shown a variant, and POST the reward to /api/v2/ingest/rewards at the point they actually convert — using the exact event name from the metric we created. Authenticate with the LEVERED_API_KEY environment variable (Authorization: Bearer), use the same anonymous_id on both, and reference the optimization you just created.
Send the events yourself with curl
Terminal
# Exposure: which variant the user saw
curl -X POST https://api.levered.dev/api/v2/ingest/exposures \
  -H "Authorization: Bearer $LEVERED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "events": [{
    "anonymous_id": "user_123",
    "optimization_id": "<your-optimization-id>",
    "variant": { "cta": "sign_up_now", "hero": "shield" }
  }] }'

# Reward: the conversion you optimize for
curl -X POST https://api.levered.dev/api/v2/ingest/rewards \
  -H "Authorization: Bearer $LEVERED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "events": [{
    "anonymous_id": "user_123",
    "name": "signup_completed",
    "value": 1
  }] }'

Use your own factor names and the event name from your metric. Rewards attribute to exposures by anonymous_id. Full field list in the Managed Warehouse reference.

That's it, you're live. Give it real traffic before reading anything into the allocation.

5. Seed test traffic (optional)

A new optimization serves nobody yet, so the dashboard is empty. Fake a first cohort to check the pipeline end to end:

Prompt for Claude Code
Using Levered, seed my new optimization with fake traffic. Send 35 requests to the serve endpoint, using a different anonymous_id on each so they look like distinct users. For each one, POST the returned variant as an exposure to /api/v2/ingest/exposures, then POST a reward to /api/v2/ingest/rewards for roughly a third of them — using the event name from our metric and reusing the same anonymous_id so the reward attributes back. Authenticate the ingest calls with the LEVERED_API_KEY environment variable (Authorization: Bearer). Then show me a summary of variants served and rewards sent.

This is synthetic data, good for verifying the pipeline but not for conclusions. Archive and recreate the optimization before real traffic, or the fake conversions stay in your results.

Next steps