Statsig
Feature flags, A/B testing, and product analytics in a single platform. Statsig connects experiments to metrics automatically, making it easy to measure the impact of every feature you ship.
Why Statsig?
Running A/B experiments and wanting automated statistical significance
Combining feature flags with product analytics in one tool
Teams wanting a more affordable LaunchDarkly alternative
Signal Breakdown
What drives the Trust Score
Download Trend
Last 12 months
Tradeoffs & Caveats
Know before you commitYou only need simple on/off flags — LaunchDarkly or Unleash have simpler SDKs
Self-hosted requirement — Statsig is cloud-only
Need extremely low-latency edge evaluation — LaunchDarkly edge SDKs are more mature
Pricing
Free tier & paid plans
1M exposures/mo
From $150/mo (Pro)
Free tier is generous for most startups
Alternative Tools
Other options worth considering
Often Used Together
Complementary tools that pair well with Statsig
Learning Resources
Docs, videos, tutorials, and courses
Get Started
Repository and installation options
View on GitHub
github.com/statsig-io/statsig-node
npm install statsig-jsnpm install statsig-nodeQuick Start
Copy and adapt to get going fast
// Server-side with statsig-node
import Statsig from 'statsig-node';
await Statsig.initialize(process.env.STATSIG_SERVER_KEY!);
const user = { userID: 'user_123', email: 'user@example.com', custom: { plan: 'pro' } };
const isEnabled = Statsig.checkGate(user, 'new_feature');
const config = Statsig.getConfig(user, 'homepage_config');
const variant = config.get('hero_text', 'Default headline');
console.log('Feature on:', isEnabled, 'Variant:', variant);
await Statsig.shutdown();Code Examples
Common usage patterns
Next.js middleware feature gate
Block/redirect users based on feature flag in middleware
// middleware.ts
import { NextRequest, NextResponse } from 'next/server';
import Statsig from 'statsig-node';
await Statsig.initialize(process.env.STATSIG_SERVER_KEY!);
export async function middleware(req: NextRequest) {
const userId = req.cookies.get('user_id')?.value ?? 'anonymous';
const user = { userID: userId };
const isInBeta = Statsig.checkGate(user, 'beta_dashboard');
if (req.nextUrl.pathname === '/dashboard' && !isInBeta) {
return NextResponse.redirect(new URL('/waitlist', req.url));
}
return NextResponse.next();
}A/B test with metric tracking
Run a checkout experiment and log conversion events
import Statsig from 'statsig-js';
await Statsig.initialize(process.env.NEXT_PUBLIC_STATSIG_CLIENT_KEY!, { userID: userId });
const exp = Statsig.getExperiment('checkout_cta');
const ctaText = exp.get('cta_text', 'Buy Now');
// Log conversion event
document.getElementById('checkout-btn')!.addEventListener('click', () => {
Statsig.logEvent('checkout_click', ctaText, { source: 'product_page' });
});Community Notes
Real experiences from developers who've used this tool