A/B Testing Built for Engineers Who Ship

TypeScript SDK, REST API, sub-100ms edge assignments. Four bandit algorithms that automatically optimize traffic. Not a marketer's drag-and-drop tool.

TypeScript
REST API
Edge-Ready
Open Source Algorithms
app.ts
import { BanditClient } from '@bandit/sdk';

const bandit = new BanditClient({
  apiUrl: 'https://api.runbandit.com',
  apiKey: 'your-api-key'
});

// Get the best variant for this user
const { treatment } = await bandit.getAssignment('headline-test', 'user-123');

// Track when they convert
bandit.trackEvent({ eventType: 'CONVERSION', value: 29.99 });

Full integration with context

Pass user context for smarter targeting. The contextual bandit uses device type, location, and custom features to personalize assignments.

app.ts
import { BanditClient } from '@bandit/sdk';

const bandit = new BanditClient({
  apiUrl: 'https://api.runbandit.com',
  apiKey: 'your-api-key'
});

// Get assignment with context for smarter targeting
const { treatment, confidence } = await bandit.getAssignment(
  'headline-experiment',
  'user-123',
  {
    deviceType: 'mobile',
    location: 'US',
    referrer: 'google'
  }
);

// Show the winning variant
document.getElementById('hero').innerHTML = treatment.config.html;

// Track conversion with value
bandit.trackEvent({
  eventType: 'CONVERSION',
  value: 29.99,
  metadata: { product: 'premium-plan' }
});

Architecture

From SDK call to optimized assignment in under 100ms.

Your App
SDK Client
Edge API
Cloudflare Workers
Algorithm Engine
In-Memory State
Dashboard
Real-Time Analytics
ConvexEdge ComputeSub-100ms E2E

Pick your algorithm

Each algorithm has different trade-offs. Choose based on your traffic and goals.

Epsilon-Greedy

ε = 0.1

When you want simplicity with a tunable exploration rate.

UCB1

Upper Confidence Bound

When you want confidence-bound driven exploration.

Thompson Sampling

Beta-Binomial Prior

When you have low traffic and need Bayesian efficiency.

Contextual Linear

Linear UCB

When user context (device, location) should inform selection.

Watch it optimize

This is a simulation of Thompson Sampling allocating traffic across three variants. In production, this happens automatically on every request.

Live ExperimentThompson Sampling
0h elapsed
Variant A
2.1% CVR36%
Variant B
2.8% CVR34%
Variant C
1.9% CVR29%

Traffic automatically shifts to the best-performing variant. No manual intervention needed.

Five steps. Five minutes.

1
Install the SDK
npm install @bandit/sdk
2
Initialize the client
new BanditClient({ apiUrl, apiKey })
3
Get an assignment
bandit.getAssignment(expId, userId)
4
Track conversions
bandit.trackEvent({ eventType, value })
5
Monitor in real-time
open dashboard → watch it optimize
Bandit

Get your API key.

Start optimizing in five minutes. Free tier available, no credit card required.