FabricFabricExperiments
Deployment

Publish and test from cloud

Deploy the docs, API, Studio, Cloudflare workers, and smoke-test the hosted environment.

There are two web surfaces:

  1. Docs site — deployable to Cloudflare Workers Assets at your documentation domain.
  2. Product web app — API + Studio, best deployed to Vercel for M5.1, with Cloudflare Workers for edge manifest/exposure/audit paths.

Publish the docs site

pnpm docs:deploy

This builds apps/docs, syncs apps/docs/out into dist/cloudflare-docs, and deploys cloudflare/docs-worker to the configured docs route.

Publish API and Studio

Deploy apps/api and apps/studio to Vercel.

API environment:

DATABASE_URL=postgres://...
BETTER_AUTH_SECRET=<32-byte secret>
MANIFEST_KEY_ENC_KEY_HEX=<32-byte hex key>
WORKER_API_TOKEN=<worker token>
FX_BASE_URL=https://api-experiments-staging.example.com
FX_TRUSTED_ORIGINS=https://studio-experiments-staging.example.com
DATABRICKS_HOST=...
DATABRICKS_HTTP_PATH=...
DATABRICKS_TOKEN=...
DATABRICKS_CATALOG=fx_staging
DATABRICKS_SCHEMA=fx

Studio environment:

FX_API_BASE_URL=https://api-experiments-staging.example.com
NEXT_PUBLIC_FX_API_BASE_URL=https://api-experiments-staging.example.com

Publish Cloudflare product workers

Provision and deploy:

cd cloudflare/manifest-worker
wrangler kv:namespace create fx_manifests --env staging
wrangler secret put HMAC_SECRET --env staging
wrangler deploy --env staging

cd ../exposure-worker
wrangler r2 bucket create fx-exposures-staging
wrangler deploy --env staging

cd ../audit-export-worker
wrangler r2 bucket create fx-audit-exports-staging
wrangler secret put WORKER_API_TOKEN --env staging
wrangler deploy --env staging

Test from cloud

After DNS and env vars are set:

curl -I https://docs.example.com/
curl -sSf https://api-experiments-staging.example.com/healthz

Run live smokes:

export FX_LIVE_TEST=1
export FX_LIVE_API_BASE_URL=https://api-experiments-staging.example.com
export FX_LIVE_API_KEY=<staging api key>
export FX_LIVE_ORG_ID=<staging org id>
export FX_LIVE_EXPERIMENT_ID=<seeded experiment id>
export FX_LIVE_WORKER_TOKEN=<worker token>

scripts/live-smoke-m3.sh
scripts/live-smoke-m4.sh
scripts/live-smoke-m5.sh

Test marketing site experiments from cloud

Once API/Studio and the manifest worker are live:

cd examples/marketing-site
fx validate experiments/
fx plan experiments/
fx apply experiments/

Then publish a signed manifest to the Cloudflare manifest worker and configure your website SDK to read it.

The YAML files alone do not alter a live website; the website must include the web SDK and map payloads to the relevant UI placements.

On this page