Feature Flags
statsig

Statsig

Feature FlagsA/B TestingAnalyticsExperimentation

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.

License

Proprietary

Language

TypeScript / Python

10
Trust
Limited

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

Weekly npm downloads
85k/wk
GitHub commits (90d)
130
GitHub stars
1.1k
Stack Overflow questions
400
Community health
Growing
Weighted Trust Score10 / 100

Download Trend

Last 12 months

Tradeoffs & Caveats

Know before you commit

You 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

Free tier

1M exposures/mo

Paid

From $150/mo (Pro)

Free tier is generous for most startups

Alternative Tools

Other options worth considering

launchdarkly
LaunchDarkly82Strong

The industry standard feature flag and experimentation platform. Safe rollouts, A/B testing, and targeting rules for any deployment strategy. Used by thousands of engineering teams for risk-free releases.

Often Used Together

Complementary tools that pair well with Statsig

nextjs

Next.js

Frontend & UI

98Excellent
View
vercel

Vercel

Hosting & Deploy

89Strong
View
supabase

Supabase

Database & Cache

95Excellent
View
posthog

PostHog

Monitoring

81Strong
View
launchdarkly

LaunchDarkly

Feature Flags

82Strong
View

Learning Resources

Docs, videos, tutorials, and courses

Get Started

Repository and installation options

View on GitHub

github.com/statsig-io/statsig-node

npm (client)npm install statsig-js
npm (server)npm install statsig-node

Quick 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