TypeScript SDK, REST API, sub-100ms edge assignments. Real bandit algorithms running on your funnel — wired in with five lines and a reward.
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 });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.
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' }
});From SDK call to optimized assignment in under 100ms.
Real bandit algorithms running at the edge. Honest math, not branded magic.
Traffic flows toward winning variants automatically — exploration vs exploitation handled by the algorithm.
Thompson Sampling, UCB1, and Epsilon-Greedy out of the box. Confidence is a real number, not a vibe.
Converges on hundreds of users per day, not the tens of thousands a fixed split needs.
Pass device, location, or custom features and opt into per-context assignments via the contextual bandit.
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.
Traffic automatically shifts to the best-performing variant. No manual intervention needed.
Drop-in is mostly drop-in — but you do have to wire the reward. We're honest about the work.
npm install @runbandit/sdknew BanditClient({ apiUrl, apiKey })bandit.getAssignment(expId, userId)bandit.trackEvent({ eventType, value })open dashboard → watch it converge
Drop in the SDK, wire your reward, let the math run. Free tier available, no credit card required.