Skip to main content
The Confidence Cloudflare resolver enables feature flag evaluation at the edge using Cloudflare Workers. Built on the Confidence Resolver WebAssembly module, it evaluates flags as close to your users as possible. You can then use the Confidence SDKs to resolve from the Cloudflare resolver, either via service binding or regular calls from clients.

Features

  • Edge evaluation: Flag rules evaluate at Cloudflare’s edge locations worldwide
  • Ultra-low latency: Evaluation happens close to users, minimizing latency
  • WebAssembly powered: Rust-based resolver compiled to WASM for performance
  • Background sync: Flag rules sync with Confidence in the background

Deployment

The Cloudflare resolver is deployed using a Docker-based deployer that handles building and publishing the Worker to your Cloudflare account.

Prerequisites

  • Docker installed
  • Cloudflare API token with Workers permissions
  • Confidence client secret

Build the deployer

From the root of the confidence-resolver repository:
docker build --target confidence-cloudflare-resolver.deployer -t confidence-cloudflare-deployer .

Deploy to Cloudflare

Run the deployer with your credentials:
docker run -it \
    -e CLOUDFLARE_API_TOKEN='your-cloudflare-api-token' \
    -e CONFIDENCE_CLIENT_SECRET='your-confidence-client-secret' \
    confidence-cloudflare-deployer
The deployer automatically detects:
  • Cloudflare account ID from your API token
  • Resolver state from Confidence CDN
  • Existing deployment to avoid unnecessary re-deploys

Optional configuration

VariableDescription
CLOUDFLARE_ACCOUNT_IDRequired only if API token has access to multiple accounts
CONFIDENCE_RESOLVER_STATE_URLCustom resolver state URL (overrides CDN)
CONFIDENCE_RESOLVER_ALLOWED_ORIGINConfigure allowed origins for CORS
FORCE_DEPLOYForce re-deploy regardless of state changes
NO_DEPLOYBuild only, skip deployment

Limitations

  • Sticky assignments: Not currently supported with the Cloudflare resolver. Flags with sticky assignment rules will return “flag not found”.

Resources