Optimization, exposed as a
getAssignment call.

TypeScript SDK, REST API, sub-100ms edge assignments. Real bandit algorithms running on your funnel — wired in with five lines and a reward.

TypeScript
REST API
Edge
Open algorithms
app.ts
import { BanditClient } from '@runbandit/sdk';

const bandit = new BanditClient({
  apiUrl: 'https://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 to opt into the contextual bandit — device, location, referrer, anything you have. Per-context assignments are a power-user toggle, not the default.

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

const bandit = new BanditClient({
  apiUrl: 'https://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

Built for production traffic

Real bandit algorithms running at the edge. Honest math, not branded magic.

Self-tuning

Zero-config

Traffic flows toward winning variants automatically — exploration vs exploitation handled by the algorithm.

Posterior-driven

Bayesian

Thompson Sampling, UCB1, and Epsilon-Greedy out of the box. Confidence is a real number, not a vibe.

Sample-efficient

Low-traffic

Converges on hundreds of users per day, not the tens of thousands a fixed split needs.

Context-aware

Contextual

Pass device, location, or custom features and opt into per-context assignments via the contextual bandit.

Watch it converge

A live simulation of traffic flowing across three variants as rewards come in. In production, this happens on every request — sub-100ms, at the edge.

Live ExperimentAuto-optimizing
0h elapsed
Variant A
2.1% CVR32%
Variant B
2.8% CVR37%
Variant C
1.9% CVR31%

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

Five steps. Then hands-off.

Drop-in is mostly drop-in — but you do have to wire the reward. We're honest about the work.

1
Install the SDK
npm install @runbandit/sdk
2
Initialize the client
new BanditClient({ apiUrl, apiKey })
3
Get an assignment
bandit.getAssignment(expId, userId)
4
Wire your reward
bandit.trackEvent({ eventType, value })
5
Watch the math run
open dashboard → watch it converge
Bandit

Grab your API key.

Drop in the SDK, wire your reward, let the math run. Free tier available, no credit card required.

Bandit for Developers — Drop-in optimization SDK — Bandit