Reflag - TypeScript Feature Flags Built for B2B SaaS
Reflag is a TypeScript-first feature flag platform purpose-built for B2B SaaS. Self-cleaning flags, company-level controls, type safety, and deep Linear and Slack integration.
TL;DR
TL;DR: Reflag is a TypeScript-first feature flag platform purpose-built for B2B SaaS companies, offering self-cleaning flags, company-level targeting, type safety, and deep Linear and Slack integration to replace homegrown flag systems.
Source and Accuracy Notes
This post is based on Reflag’s official documentation at docs.reflag.com and the product’s structured llms.txt. Reflag was previously known as Bucket (launched on Show HN in 2023) and rebranded to focus on TypeScript feature management for SaaS. The product is actively developed with a public changelog.
What Is Reflag?
Reflag is a feature flag management platform designed specifically for B2B SaaS companies building with TypeScript. Unlike general-purpose feature flag tools that treat companies as an afterthought, Reflag makes working with company-level targeting as straightforward as user-level targeting.
The platform differentiates itself through several capabilities that address common pain points in feature management:
- Self-cleaning flags - Stale flag detection, AI-powered code removal via GitHub PRs, and automatic archiving
- Company-level controls - Target features by company attributes, plans, and segments rather than just individual users
- Strong type-safety - Flag keys are typed at the SDK level, catching errors at compile time
- Agent-ready - MCP protocol support lets AI coding agents manage flags directly from your IDE
- Early-access workflow - Built-in beta management with opt-in pages and feedback collection
- Zero maintenance - Put flag cleanup on autopilot so engineering time goes to building features, not managing flags
Setup Workflow
Step 1: Install the SDK
Reflag provides official SDKs for the most common TypeScript stacks. Install via npm:
npm install @reflag/react
# or for Node.js backends
npm install @reflag/node
The SDK supports React, Vue.js, Next.js, Node.js, Browser, React Native, and Ruby. Reflag also provides an OpenFeature provider for teams that want vendor-neutral SDK integration.
Step 2: Initialize the Client
Create a Reflag app in the dashboard, then initialize the client with your app’s public key:
import { ReflagProvider } from '@reflag/react';
<ReflagProvider appKey="your-app-key">
<App />
</ReflagProvider>
For server-side evaluation in Next.js, use the Node SDK with local evaluation enabled for sub-millisecond flag checks and downtime protection.
Step 3: Create Your First Feature Flag
Define a feature in the Reflag dashboard with targeting rules. Flags support:
- Percentage rollouts - Gradually release to a percentage of companies
- Attribute-based targeting - Target by company plan, region, or custom attributes
- Segment-based targeting - Apply pre-built company segments
- Release stages - Move flags through Alpha, Beta, GA stages with visibility into which stage each flag is in
import { useFlag } from '@reflag/react';
function ExportButton() {
const { isEnabled } = useFlag('export-as-csv');
if (!isEnabled) return null;
return <button>Export as CSV</button>;
}
Step 4: Enable Self-Cleaning
Turn on automated stale flag detection in the dashboard. When a flag has been fully rolled out and inactive for a configurable period, Reflagbot creates a GitHub PR that removes the flag code from your codebase. This is the only feature flag tool that actively removes obsolete flag code for you.
Step 5: Connect Linear and Slack
Install the Linear integration to create and manage feature flags directly from Linear issues. The Slack integration delivers weekly Focus reports, flag archive reminders, and real-time notifications when targeting rules change.
Deeper Analysis
Why TypeScript-First Matters
Most feature flag tools are language-agnostic, which means they cannot provide compile-time guarantees about flag keys. Reflag’s TypeScript focus enables type-safe flag evaluation where misspelled flag keys are caught by the compiler rather than causing runtime errors in production. The CLI generates type definitions from your flag configuration, so your IDE knows about every flag and its expected return type.
Company-Level Targeting for B2B
B2B SaaS companies sell to organizations, not individuals. A feature might need to be available to all users at companies on the Enterprise plan, or to companies in a specific region. Reflag models companies as first-class entities with attributes, segments, and entitlements. This is fundamentally different from tools designed for B2C where every user is independent.
The STARS framework (Sign-up, Trial, Adopted, Retained, Satisfied) provides a standardized way to measure feature adoption at the company level. Every feature automatically gets a STARS funnel showing how far customers have progressed through the adoption journey.
Self-Cleaning Flags Solve a Real Problem
Feature flag debt is a well-known problem. Teams create flags for experiments and rollouts, then forget to remove them after the feature is fully launched. Over time, the codebase accumulates dead flag checks that slow down evaluation and confuse new engineers.
Reflag addresses this with three mechanisms:
- Stale flag detection - Automatically identifies flags that have been inactive or fully rolled out
- AI code cleanup - Creates GitHub PRs that remove flag code from your codebase
- Auto-archiving - Archives flags after a configurable inactivity period
This is not just a convenience feature. For teams with hundreds of flags, manual cleanup is a recurring maintenance burden that rarely gets prioritized.
MCP Integration for AI Agents
Reflag supports the Model Context Protocol (MCP), which means AI coding agents in Cursor, VS Code, Windsurf, or Claude can read and modify flag configuration directly from the editor. An agent working on a feature can check whether a flag exists, create a new flag, or update targeting rules without leaving the coding context.
Local Evaluation and Downtime Protection
The Node.js SDK supports local evaluation, where flag rules are downloaded and evaluated locally. This provides two benefits: sub-millisecond flag checks (no network round-trip) and continued operation if the Reflag service is temporarily unavailable. Your application keeps working even if Reflag has an outage.
Practical Evaluation Checklist
- [ ] TypeScript project - Reflag is TypeScript-first. If your stack is Python, Go, or Java, look elsewhere
- [ ] B2B SaaS - Company-level targeting is the core differentiator. B2C products will not benefit as much
- [ ] Flag cleanup pain - If your team struggles with stale flags, the self-cleaning feature alone justifies evaluation
- [ ] Linear user - The Linear integration is deep. Teams already using Linear get significant workflow benefits
- [ ] OpenFeature compatibility - If you need vendor-neutral SDKs, Reflag provides an OpenFeature provider
- [ ] EU data residency - All data is hosted in the EU, which matters for GDPR-sensitive customers
- [ ] Free tier available - You can start for free and upgrade as you scale
Security Notes
Reflag stores all data in the EU on secure infrastructure. The platform supports:
- Secret features - Mark backend-only flags so the flag key is never exposed to client-side code
- Team permissions - Role-based access control for team members
- Audit trail - All flag changes are logged with who made the change and when
- GDPR compliance - Full GDPR compliance with DPA available
- Service resiliency - Local evaluation ensures your app works even if Reflag is unavailable
The SDK does not require source code access and requests minimal permissions. Flag evaluation happens client-side with rules downloaded from the server, so flag logic cannot be tampered with from the client.
FAQ
Q: How does Reflag compare to LaunchDarkly? A: Reflag is purpose-built for B2B SaaS with company-level targeting as a first-class concept. LaunchDarkly is a general-purpose platform that works for B2C and B2B but does not model companies natively. Reflag also includes self-cleaning flags and the STARS adoption framework out of the box.
Q: Can I migrate from LaunchDarkly? A: Yes. Reflag provides a flag import tool that migrates all your flags and segments from LaunchDarkly. The process is documented in the flag import guide.
Q: Does Reflag work with non-TypeScript projects? A: Reflag provides a Ruby SDK for Rails applications and supports OpenFeature for vendor-neutral integration. However, the type-safety features and CLI are TypeScript-specific. The core platform works with any language via the REST API.
Q: What happens if Reflag goes down? A: The Node.js SDK supports local evaluation, where flag rules are cached locally. Your application continues to evaluate flags correctly even if the Reflag service is temporarily unavailable. The SDK also includes a rollback button for emergency flag disabling.
Q: Is there a free plan? A: Reflag offers a free tier to get started. Pricing scales with usage as your product grows. Details are available on the pricing page.
Conclusion
Reflag fills a specific gap in the feature flag market: TypeScript-first, B2B SaaS-focused feature management with automated flag cleanup. The company-level targeting model, self-cleaning flags, and deep Linear integration make it a compelling choice for teams that have outgrown homegrown flag systems or find general-purpose tools too generic for their B2B workflow.
The rebrand from Bucket to Reflag signals a clear product direction. The extensive changelog shows consistent shipping cadence, and the MCP integration positions the platform for the AI-assisted development era. If your team builds B2B SaaS with TypeScript and struggles with feature flag maintenance, Reflag deserves a serious look.
Related Posts
dev-tools
Automotive Skills Suite for AI Engineering
Evaluate Automotive Skills Suite for APQP, ASPICE, HARA, safety-plan, and DIA workflows with setup notes, governance risks, and SME review guidance.
5/28/2026
dev-tools
awesome-agentic-ai-zh Roadmap Guide
Explore awesome-agentic-ai-zh as a Chinese agentic AI learning roadmap, with setup notes, track selection, study workflow, and evaluation guidance.
5/28/2026
dev-tools
Baguette iOS Simulator Automation Guide
Set up Baguette for iOS Simulator automation, web dashboards, device farms, gesture input, streaming, and camera testing with Xcode caveats.
5/28/2026