Railway Feature Flags
Product · SaaS / cloud software by Railway
Ship code dark and flip it on when you're ready with native feature flags.
A native feature management system for Railway developers to handle gradual rollouts and kill switches without redeploying. It supports typed flags and complex targeting rules via dashboard, CLI, and SDK.
- Launched
- 2026-07-10
Category: DevOps
- Deployment
- Cloud
- Platforms
- Web, API, CLI
- APIs and SDKs
- TypeScript SDK
- Supported Data Types
- Boolean, String, Number, JSON
- Management Interfaces
- Dashboard, CLI, SDK
- SDK Language
- TypeScript
- Modify application behavior at runtime without redeploying
- Supports Boolean, String, Number, and JSON flag types
- Percentage-based rollouts and attribute-based targeting
- Native TypeScript SDK with synchronous, in-process reads
Overview
Railway Feature Flags is a typed configuration registry built into the Railway cloud platform for managing application behavior at runtime. It allows developers to define flags as booleans, strings, numbers, or JSON values and modify them without triggering a service redeploy. Users can manage flags through a visual dashboard, the Railway CLI, or a dedicated TypeScript SDK. Targeting rules support percentage-based bucketing and attribute-based gating, such as restricting features to specific subscription plans. Changes take effect in seconds, enabling teams to ship code dark and flip features on when ready.
Feature Management
- Typed Configuration Registry: Developers can define flags as boolean, string, number, or JSON values to control application behavior at runtime.
- Instant Runtime Updates: Flag values can be modified instantly from the dashboard or CLI without requiring a code redeploy.
- Gradual Rollouts: The system supports percentage-based bucketing to roll features out to a specific portion of the user base.
- Kill Switches: Features can be shut off everywhere instantly using flags as kill switches.
Developer Experience
- Dashboard Management Interface: Users can create flags, edit values, and add targeting rules directly from the project settings in the dashboard.
- CLI Integration: The CLI supports listing flags and setting values with targeting rules using the 'railway flag' command.
- Native TypeScript SDK: The TypeScript SDK allows reading flags directly from code with synchronous, in-process reads.
- Background Polling: The SDK uses background polling to keep flag values fresh without blocking application requests.
Targeting and Rules
- Plan-Based Gating: Targeting rules can gate features to specific plans, such as enabling a feature only for Enterprise users.
- Contextual Targeting: Rules compare context attributes passed from the application to determine flag values for specific users.
- Default Fallbacks: When no targeting rule matches a specific context, the flag automatically falls back to its defined default value.
Use cases
- Developers roll out new features to 25% of users to monitor performance before a full release.
- Engineering teams use flags as kill switches to instantly disable buggy features without waiting for a redeploy.
- Product managers gate premium features to users on specific enterprise plans using targeting rules.
- Teams perform runtime tuning of application parameters like timeout values or UI strings through the dashboard.
Specifications
- Deployment
- Cloud
- Platforms
- Web, API, CLI
- APIs and SDKs
- TypeScript SDK
- Supported Data Types
- Boolean, String, Number, JSON
- Management Interfaces
- Dashboard, CLI, SDK
- SDK Language
- TypeScript
- Update Latency
- Seconds
- Targeting Methods
- Percentage-based, Attribute-based
- Read Performance
- Synchronous, in-process
How it works
- Define Flags: Define a new flag as a bool, string, number, or JSON value in the Railway dashboard under Settings -> Feature Flags.
- Integrate SDK: Initialize the TypeScript SDK with a project token and use methods like getBoolean to check flag states in your code.
- Set Targeting Rules: Create targeting rules in the dashboard or via the CLI to control rollouts based on user attributes or percentages.
- Manage at Runtime: Update flag values or toggle kill switches instantly from the dashboard or CLI to see changes in your live app within seconds.
FAQ
How do feature flags differ from environment variables on Railway?
Railway Feature Flags allow for runtime changes that take effect in seconds without a redeploy, whereas changing a variable requires a full service redeployment.
Where can I manage my Railway Feature Flags?
You can manage flags through the Railway dashboard under Project Settings, via the Railway CLI using 'railway flag' commands, or through the native TypeScript SDK.
Can I roll out features to only a percentage of my users?
Yes, the system supports percentage-based bucketing and targeting rules based on context attributes like user ID or subscription plan.
Does checking a feature flag add latency to my application?
The TypeScript SDK performs synchronous, in-process reads with background polling, ensuring that checking a flag never blocks a request.
Added by AntSpace from public sources (railway.com).