Skip to content

Deploying FeatBit

Introduction

FeatBit is a powerful open-source feature flag management platform that empowers development teams to deploy code confidently, test features safely, and control rollouts precisely. Built with modern architecture using .NET Core and Vue.js, FeatBit provides enterprise-grade feature management without vendor lock-in or per-seat pricing.

Feature flags (also called feature toggles) let you deploy code to production with features turned off, then enable them gradually for specific users, regions, or segments. This approach dramatically reduces deployment risk, enables A/B testing, and allows instant rollback without redeployment. FeatBit makes this workflow accessible to teams of any size.

Key Features

  • Real-Time Flag Updates - Feature changes propagate instantly without application restarts
  • Granular Targeting - Target features by user attributes, segments, percentages, or custom rules
  • Multi-Environment Support - Separate flags for development, staging, and production environments
  • A/B Testing & Experimentation - Run controlled experiments with statistical analysis
  • Progressive Rollouts - Gradually release features with percentage-based targeting
  • Team Collaboration - Role-based access control, approval workflows, and audit logs
  • Multi-Project Management - Organize flags across multiple projects and teams
  • SDK Support - Official SDKs for JavaScript, React, Node.js, .NET, Java, Python, Go, and more
  • Real-Time Dashboard - Monitor flag status, user targeting, and rollout progress
  • Webhook Integration - Trigger external systems when flags change
  • Data Export - Export flag configurations and audit logs for compliance
  • Self-Hosted - Complete control over your data and infrastructure
  • Open Source - MIT licensed with active community development
  • API-First Design - Comprehensive REST API for automation and integration

Why Deploy FeatBit on Klutch.sh?

Deploying FeatBit on Klutch.sh gives your team complete control over feature management infrastructure:

  • Data Sovereignty - Your feature flags and user data stay on your infrastructure
  • No Per-Seat Pricing - Unlimited team members without recurring per-user costs
  • High Availability - Reliable infrastructure for mission-critical feature management
  • Fast Deployment - Automatic Dockerfile detection gets FeatBit running in minutes
  • Persistent Storage - Reliable storage for flag configurations and audit logs
  • Custom Domains - Professional access at your own domain
  • Automatic HTTPS - Built-in SSL certificates for secure flag delivery
  • Scalable Architecture - Handle high-traffic applications with ease
  • Environment Isolation - Deploy separate instances for dev, staging, and production

Prerequisites

Before deploying FeatBit on Klutch.sh, ensure you have:

Preparing Your Repository

FeatBit consists of multiple services, but for a simplified deployment, we’ll focus on the core API and UI components. Create a new directory for your FeatBit deployment:

Terminal window
mkdir featbit-deployment
cd featbit-deployment

Creating the Dockerfile

Create a Dockerfile in the root of your repository. We’ll use FeatBit’s official Docker images:

# FeatBit API Server Dockerfile
FROM featbit/featbit-api-server:latest
# Set environment variables
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000
# MongoDB connection
ENV MongoDb__ConnectionString=""
ENV MongoDb__Database=featbit
# Redis connection
ENV Redis__ConnectionString=""
# CORS settings (configure based on your UI domain)
ENV CORS__Origins=http://localhost:8081,https://your-domain.klutch.sh
# JWT settings (change this to a secure random string)
ENV JWT__SecretKey=YourSecretKeyHerePleaseChangeThis123456789
ENV JWT__Issuer=featbit-api
ENV JWT__Audience=featbit-client
# Feature flag settings
ENV FeatureFlag__DefaultReturnValue=false
# Logging
ENV Logging__LogLevel__Default=Information
ENV Logging__LogLevel__Microsoft=Warning
# Health check settings
ENV HealthChecks__Enabled=true
# Expose the API port
EXPOSE 5000
# The base image already has the correct ENTRYPOINT
# Start the FeatBit API server
CMD ["dotnet", "Api.dll"]

Alternative: FeatBit UI Dockerfile

If you want to deploy the UI separately, create a Dockerfile.ui:

# FeatBit UI Dockerfile
FROM featbit/featbit-ui:latest
# Environment variables for API connection
ENV API_URL=https://api-featbit.klutch.sh
# Nginx configuration
ENV NGINX_PORT=8081
# Expose the UI port
EXPOSE 8081
# The base image already handles the entrypoint
CMD ["nginx", "-g", "daemon off;"]

Docker Compose for Local Development

For local testing, create a docker-compose.yml file (not used for Klutch.sh deployment):

version: '3.8'
services:
mongodb:
image: mongo:7
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: password
volumes:
- mongodb_data:/data/db
redis:
image: redis:7-alpine
ports:
- "6379:6379"
command: redis-server --requirepass yourredispassword
api-server:
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
environment:
MongoDb__ConnectionString: mongodb://admin:password@mongodb:27017
Redis__ConnectionString: redis:6379,password=yourredispassword
CORS__Origins: http://localhost:8081
depends_on:
- mongodb
- redis
ui:
build:
context: .
dockerfile: Dockerfile.ui
ports:
- "8081:8081"
environment:
API_URL: http://localhost:5000
depends_on:
- api-server
volumes:
mongodb_data:

Test locally:

Terminal window
docker-compose up -d

Access FeatBit at http://localhost:8081 and the API at http://localhost:5000.

Initialize Git Repository

Initialize your repository and push to GitHub:

Terminal window
git init
git add Dockerfile docker-compose.yml
git commit -m "Initial FeatBit configuration"
git branch -M main
git remote add origin https://github.com/yourusername/featbit-deployment.git
git push -u origin main

Deploying FeatBit API on Klutch.sh

  1. Navigate to the Klutch.sh Dashboard

    Go to klutch.sh/app and sign in to your account.

  2. Create a New Project

    Click “New Project” and give it a meaningful name like featbit-production or feature-flags.

  3. Create a New App

    Inside your project, click “New App” and select your GitHub repository containing the FeatBit configuration.

  4. Configure Build Settings

    Klutch.sh will automatically detect your Dockerfile and use it for deployment. No additional build configuration is needed.

  5. Configure Environment Variables

    In the Environment Variables section, add the following variables:

    MongoDB Connection:

    • MongoDb__ConnectionString: mongodb://username:password@mongodb-app.klutch.sh:8000
    • MongoDb__Database: featbit

    Redis Connection:

    • Redis__ConnectionString: redis-app.klutch.sh:8000,password=yourredispassword

    Security Settings:

    • JWT__SecretKey: YourVerySecureRandomStringHere123456789AbCdEf (generate a secure random string)
    • JWT__Issuer: featbit-api
    • JWT__Audience: featbit-client

    CORS Configuration:

    • CORS__Origins: https://featbit-ui.klutch.sh (adjust based on your UI domain)

    Application Settings:

    • ASPNETCORE_ENVIRONMENT: Production
    • ASPNETCORE_URLS: http://+:5000
    • FeatureFlag__DefaultReturnValue: false

    Logging:

    • Logging__LogLevel__Default: Information
    • Logging__LogLevel__Microsoft: Warning
  6. Configure Traffic Settings

    Set the traffic type to HTTP and specify the internal port as 5000 (FeatBit API’s default port).

  7. Deploy the Application

    Click “Deploy” to start the deployment. Klutch.sh will build your Docker image and deploy FeatBit.

  8. Access Your FeatBit API

    Once deployed, your FeatBit API will be accessible at https://your-app-name.klutch.sh.

Deploying FeatBit UI on Klutch.sh

  1. Create a Separate App for the UI

    In the same project, click “New App” and select your repository.

  2. Use UI Dockerfile

    If you created a separate Dockerfile.ui, you’ll need to rename it to Dockerfile in a separate branch or repository, as Klutch.sh only detects Dockerfile in the root.

    Alternatively, create a separate repository for the UI component.

  3. Configure Environment Variables

    Add the following environment variable:

    • API_URL: https://featbit-api.klutch.sh (URL of your deployed API)
  4. Configure Traffic Settings

    Set the traffic type to HTTP and specify the internal port as 8081.

  5. Deploy the UI

    Click “Deploy” to launch the FeatBit user interface.

Configuration

Database Setup

FeatBit requires MongoDB for persistent storage. The initial connection will automatically create the necessary collections. Make sure your MongoDB instance is deployed and accessible before starting FeatBit.

See our MongoDB deployment guide for detailed setup instructions.

Redis Configuration

Redis is used for caching and real-time flag updates. FeatBit uses Redis Pub/Sub for broadcasting flag changes across multiple API instances.

Configure Redis connection string format:

host:port,password=yourpassword,ssl=false,abortConnect=false

For Klutch.sh deployed Redis instances:

redis-app.klutch.sh:8000,password=yourredispassword,ssl=false

See our Redis deployment guide for detailed setup instructions.

JWT Security

The JWT secret key is critical for authentication security. Generate a strong random string:

Terminal window
# Generate a secure random string (Linux/macOS)
openssl rand -base64 32
# Or using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"

Use this value for the JWT__SecretKey environment variable.

CORS Configuration

Configure CORS to allow your UI domain to access the API. Set CORS__Origins to include all domains that will access your API:

https://featbit-ui.klutch.sh,https://featbit.yourdomain.com

Multiple origins should be comma-separated with no spaces.

Initial Setup

First Login

When you first access FeatBit, you’ll need to create an admin account:

  1. Navigate to your FeatBit UI at `https://featbit-ui-app.klutch.sh`
  2. Click **"Sign Up"** to create the first administrator account
  3. Enter your email address and a strong password
  4. The first user created automatically becomes the system administrator

Creating Your First Organization

After logging in:

  1. Click **"Create Organization"** in the welcome screen
  2. Enter your organization name (e.g., "Acme Corp" or "Development Team")
  3. Choose a unique organization key (used in API calls)
  4. Click **"Create"** to set up your organization

Creating Projects and Environments

  1. Click **"Create Project"** to organize your feature flags
  2. Enter project name (e.g., "Web App" or "Mobile App")
  3. FeatBit automatically creates default environments: Development, Staging, Production
  4. Each environment has a unique SDK key for connecting applications

Creating Feature Flags

Basic Flag Creation

  1. Navigate to your project and select an environment
  2. Click **"Create Feature Flag"**
  3. Enter flag details: - **Name**: User-friendly name (e.g., "New Dashboard") - **Key**: Machine-readable identifier (e.g., "new-dashboard") - **Description**: What this flag controls - **Flag Type**: Boolean, String, Number, or JSON
  4. Set default values: - **Default Value**: Value when flag is off - **Variations**: Different values the flag can return
  5. Click **"Create"** to save the flag

Targeting Rules

Create sophisticated targeting rules:

Target by User Attributes:

// User object in your application
{
"key": "user-123",
"name": "John Doe",
"email": "john@example.com",
"customAttributes": {
"plan": "premium",
"region": "us-west",
"betaUser": true
}
}

Create Targeting Rule:

  1. In flag settings, go to **"Targeting"** tab
  2. Click **"Add Rule"**
  3. Set conditions: - If `plan` equals `premium` - AND `region` equals `us-west` - Then serve variation: `true`
  4. Set rule priority by drag-and-drop

Percentage Rollouts:

  1. Create a rollout rule
  2. Set percentage split (e.g., 10% true, 90% false)
  3. Users are consistently bucketed based on user key
  4. Gradually increase percentage as confidence grows

User Segments

Group users with common attributes:

  1. Navigate to **"Segments"** in your project
  2. Click **"Create Segment"**
  3. Define segment criteria: - **Name**: "Premium Users" - **Conditions**: `plan` equals `premium` OR `plan` equals `enterprise`
  4. Use segments in flag targeting rules

SDK Integration Examples

JavaScript/TypeScript SDK

Installation:

Terminal window
npm install @featbit/js-client-sdk

Browser Usage:

import { FeatBitClient } from '@featbit/js-client-sdk';
const client = new FeatBitClient({
sdkKey: 'your-client-side-sdk-key',
apiUrl: 'https://featbit-api.klutch.sh',
user: {
key: 'user-123',
name: 'John Doe',
email: 'john@example.com',
customProperties: {
plan: 'premium',
region: 'us-west'
}
}
});
// Wait for SDK to initialize
await client.waitForInitialization();
// Check feature flag
const showNewDashboard = client.variation('new-dashboard', false);
if (showNewDashboard) {
// Show new dashboard
console.log('Rendering new dashboard');
} else {
// Show old dashboard
console.log('Rendering classic dashboard');
}
// Listen for flag changes
client.on('update', (changes) => {
console.log('Flags updated:', changes);
// Re-render UI with new flag values
});

React SDK

Installation:

Terminal window
npm install @featbit/react-client-sdk

Usage:

import { FeatBitProvider, useFeatureFlag } from '@featbit/react-client-sdk';
// Wrap your app with provider
function App() {
const user = {
key: 'user-123',
name: 'John Doe',
customProperties: { plan: 'premium' }
};
return (
<FeatBitProvider
sdkKey="your-client-side-sdk-key"
apiUrl="https://featbit-api.klutch.sh"
user={user}
>
<Dashboard />
</FeatBitProvider>
);
}
// Use flags in components
function Dashboard() {
const showNewDashboard = useFeatureFlag('new-dashboard', false);
return (
<div>
{showNewDashboard ? (
<NewDashboard />
) : (
<ClassicDashboard />
)}
</div>
);
}

Node.js Server SDK

Installation:

Terminal window
npm install @featbit/node-server-sdk

Usage:

const { FeatBitClient } = require('@featbit/node-server-sdk');
const client = new FeatBitClient({
sdkKey: 'your-server-side-sdk-key',
apiUrl: 'https://featbit-api.klutch.sh'
});
// Wait for initialization
await client.waitForInitialization();
// Express.js middleware example
app.use(async (req, res, next) => {
const user = {
key: req.user.id,
name: req.user.name,
email: req.user.email,
customProperties: {
plan: req.user.subscription.plan,
region: req.user.region
}
};
// Check feature flag for this user
req.features = {
newAPI: await client.variation('new-api-version', user, false),
rateLimit: await client.variation('rate-limit-tier', user, 'standard'),
betaFeatures: await client.variation('beta-features', user, false)
};
next();
});
// Use in route handlers
app.get('/api/data', async (req, res) => {
if (req.features.newAPI) {
// Use new API implementation
return res.json(await getDataV2());
} else {
// Use legacy API
return res.json(await getDataV1());
}
});

Python SDK

Installation:

Terminal window
pip install featbit-python-sdk

Usage:

from featbit import FeatBitClient
# Initialize client
client = FeatBitClient(
sdk_key='your-server-side-sdk-key',
api_url='https://featbit-api.klutch.sh'
)
# Wait for initialization
client.wait_for_initialization()
# Define user context
user = {
'key': 'user-123',
'name': 'John Doe',
'email': 'john@example.com',
'customProperties': {
'plan': 'premium',
'region': 'us-west'
}
}
# Check feature flag
show_new_feature = client.variation('new-feature', user, False)
if show_new_feature:
print('New feature enabled')
else:
print('Old feature active')
# Get all flags for user
all_flags = client.all_variations(user)
print(f'All flags: {all_flags}')
# Clean up
client.close()

.NET SDK

Installation:

Terminal window
dotnet add package FeatBit.ServerSdk

Usage:

using FeatBit.Sdk.Server;
// Initialize client
var client = new FeatBitClient(new FeatBitOptions
{
SdkKey = "your-server-side-sdk-key",
ApiUrl = "https://featbit-api.klutch.sh"
});
// Wait for initialization
await client.WaitForInitializationAsync();
// Define user
var user = new User
{
Key = "user-123",
Name = "John Doe",
Email = "john@example.com",
Custom = new Dictionary<string, string>
{
{ "plan", "premium" },
{ "region", "us-west" }
}
};
// Check boolean flag
bool showNewFeature = await client.BoolVariationAsync("new-feature", user, false);
if (showNewFeature)
{
// Enable new feature
Console.WriteLine("New feature enabled");
}
// Check string flag
string theme = await client.StringVariationAsync("ui-theme", user, "light");
// Check number flag
int rateLimit = await client.IntVariationAsync("rate-limit", user, 100);
// Get all flags
var allFlags = await client.AllVariationsAsync(user);

A/B Testing and Experiments

Creating an Experiment

  1. Navigate to **"Experiments"** in your project
  2. Click **"Create Experiment"**
  3. Configure experiment: - **Name**: "Checkout Button Color Test" - **Hypothesis**: "Green button increases conversions" - **Metric**: "checkout_completed" - **Variations**: - Control: "blue" (50%) - Treatment: "green" (50%)
  4. Set experiment duration and traffic allocation
  5. Click **"Start Experiment"**

Tracking Metrics

JavaScript SDK:

// Track conversion event
client.track('checkout_completed', {
value: 99.99,
currency: 'USD'
});
// Track custom event
client.track('button_clicked', {
buttonId: 'checkout-primary',
buttonColor: client.variation('checkout-button-color', 'blue')
});

Node.js SDK:

// Track metric in backend
await client.track('api_call_completed', user, {
endpoint: '/api/checkout',
duration: 234,
success: true
});

Analyzing Results

  1. Navigate to your experiment in the FeatBit dashboard
  2. View real-time metrics: - Conversion rate per variation - Statistical significance - Confidence intervals
  3. FeatBit calculates: - P-value (statistical significance) - Relative improvement - Sample size recommendations
  4. Stop experiment when significance reached
  5. Roll out winning variation to all users

Team Collaboration

User Roles and Permissions

FeatBit supports role-based access control:

Organization Roles:

  • Owner: Full access to all organization settings
  • Admin: Manage projects, environments, and users
  • Member: Create and modify flags in assigned projects
  • Reader: View-only access to flags and settings

Project-Level Permissions:

  1. Navigate to **"Team"** in organization settings
  2. Click **"Invite Member"**
  3. Enter email address and select role
  4. Choose which projects they can access
  5. Send invitation

Approval Workflows

Enable approval workflows for production changes:

  1. Navigate to **"Settings"** → **"Approval Workflows"**
  2. Enable approvals for production environment
  3. Configure: - **Required Approvers**: Minimum number of approvals - **Reviewers**: Who can approve changes - **Bypass**: Owners can bypass approvals
  4. When member changes production flag: - Change request created - Reviewers notified - Requires approval before applying

Audit Logs

Track all changes to feature flags:

  1. Navigate to **"Audit Logs"** in your project
  2. View complete history: - Who made the change - What was changed - When it occurred - Before/after values
  3. Filter by: - User - Flag - Environment - Date range
  4. Export logs for compliance

Production Best Practices

High Availability Setup

Deploy multiple FeatBit API instances behind a load balancer:

  1. Deploy 2+ FeatBit API instances on Klutch.sh
  2. Configure shared MongoDB and Redis instances
  3. Redis Pub/Sub ensures flag changes propagate across all instances
  4. Use external load balancer or Klutch.sh's built-in routing

SDK Best Practices

Client-Side SDKs:

// Use streaming updates for real-time flags
const client = new FeatBitClient({
sdkKey: 'your-sdk-key',
apiUrl: 'https://featbit-api.klutch.sh',
streamingEnabled: true, // Enable WebSocket streaming
startWaitTime: 3000 // Maximum wait for initialization
});
// Always provide default values
const flagValue = client.variation('feature-key', defaultValue);
// Handle initialization failure gracefully
if (!client.isInitialized()) {
console.warn('FeatBit not initialized, using defaults');
}

Server-Side SDKs:

// Initialize once at application startup
const client = new FeatBitClient({
sdkKey: 'your-server-sdk-key',
apiUrl: 'https://featbit-api.klutch.sh',
pollingInterval: 30000, // Poll for updates every 30 seconds
connectTimeout: 5000
});
// Reuse client across requests
app.locals.featbit = client;
// Graceful shutdown
process.on('SIGTERM', () => {
client.close();
process.exit(0);
});

Flag Naming Conventions

Establish consistent naming patterns:

{project}-{feature}-{type}
Examples:
- web-checkout-redesign
- mobile-push-notifications
- api-rate-limiting
- all-maintenance-mode

Best Practices:

  • Use kebab-case for flag keys
  • Include project prefix for multi-project organizations
  • Use descriptive names that explain purpose
  • Archive outdated flags regularly

Environment Strategy

Development Environment:

  • Use for testing new flags
  • Enable flags for all developers
  • Rapid iteration and experimentation

Staging Environment:

  • Mirror production configuration
  • Test flag changes before production
  • Validate targeting rules with production-like data

Production Environment:

  • Require approvals for changes
  • Use gradual rollouts
  • Monitor metrics closely
  • Enable audit logging

Monitoring and Alerting

Monitor Flag Usage:

// Track flag evaluation count
client.on('evaluation', (flag, value) => {
metrics.increment('featbit.evaluation', {
flag: flag.key,
value: value
});
});
// Monitor SDK health
setInterval(() => {
if (!client.isInitialized()) {
logger.error('FeatBit SDK not connected');
alerts.notify('FeatBit SDK connection lost');
}
}, 60000);

Set Up Alerts:

  • SDK connection failures
  • High flag evaluation latency
  • Unexpected flag value changes
  • Failed approval workflows

Security Hardening

API Security:

Terminal window
# Use strong JWT secrets (minimum 32 characters)
JWT__SecretKey=$(openssl rand -base64 32)
# Enable HTTPS only
ASPNETCORE_URLS=https://+:5000
# Restrict CORS to known domains
CORS__Origins=https://app.yourdomain.com,https://admin.yourdomain.com
# Enable rate limiting (if supported)
RateLimit__Enabled=true
RateLimit__RequestsPerMinute=1000

SDK Key Management:

  • Use client-side SDK keys for public applications (read-only)
  • Use server-side SDK keys for backend services (full access)
  • Rotate SDK keys quarterly
  • Never commit SDK keys to version control
  • Use environment variables for SDK keys

Database Security:

  • Enable MongoDB authentication
  • Use strong passwords (minimum 16 characters)
  • Enable Redis password authentication
  • Restrict network access to database ports
  • Regular security updates for MongoDB and Redis

Backup and Disaster Recovery

MongoDB Backups:

Terminal window
# Backup all flag configurations
mongodump --uri="mongodb://user:pass@mongodb-app.klutch.sh:8000/featbit" --out=/backups/featbit-$(date +%Y%m%d)
# Restore from backup
mongorestore --uri="mongodb://user:pass@mongodb-app.klutch.sh:8000" /backups/featbit-20250101

Configuration Export:

  1. Navigate to project settings
  2. Click **"Export Configuration"**
  3. Download JSON file with all flags
  4. Store in version control or secure backup

Disaster Recovery Plan:

  1. Document MongoDB and Redis connection strings
  2. Backup flag configurations weekly
  3. Test restoration process quarterly
  4. Keep emergency contact list for team members
  5. Document rollback procedures

Troubleshooting

API Connection Issues

Problem: SDK cannot connect to FeatBit API

Solutions:

// Check API URL configuration
console.log('API URL:', client.config.apiUrl);
// Verify network connectivity
fetch('https://featbit-api.klutch.sh/health')
.then(res => res.json())
.then(data => console.log('API Health:', data))
.catch(err => console.error('Connection failed:', err));
// Enable debug logging
const client = new FeatBitClient({
sdkKey: 'your-sdk-key',
apiUrl: 'https://featbit-api.klutch.sh',
logger: {
debug: (msg) => console.log('[DEBUG]', msg),
error: (msg) => console.error('[ERROR]', msg)
}
});

Check Environment Variables:

Terminal window
# Verify CORS configuration allows your domain
echo $CORS__Origins
# Verify API is accessible
curl https://featbit-api.klutch.sh/health

MongoDB Connection Errors

Problem: API cannot connect to MongoDB

Solutions:

  1. Verify MongoDB is running and accessible on port 8000
  2. Check connection string format: ```bash mongodb://username:password@mongodb-app.klutch.sh:8000/featbit?authSource=admin ```
  3. Test connection from API container: ```bash # Inside API container mongosh "mongodb://user:pass@mongodb-app.klutch.sh:8000/featbit" ```
  4. Check MongoDB authentication: ```javascript // Ensure user has proper permissions db.createUser({ user: "featbit", pwd: "securepassword", roles: [{ role: "readWrite", db: "featbit" }] }); ```

Redis Connection Issues

Problem: Real-time flag updates not working

Solutions:

  1. Verify Redis connection string format: ``` redis-app.klutch.sh:8000,password=yourpassword,ssl=false,abortConnect=false ```
  2. Test Redis connectivity: ```bash redis-cli -h redis-app.klutch.sh -p 8000 -a yourpassword PING ```
  3. Check Redis authentication: ```bash # In Redis configuration requirepass yourredispassword ```
  4. Monitor Redis Pub/Sub: ```bash redis-cli -h redis-app.klutch.sh -p 8000 -a yourpassword > SUBSCRIBE featbit:* ```

Flag Not Updating in Real-Time

Problem: Changes in FeatBit UI don’t reflect in application

Solutions:

  1. Verify SDK streaming is enabled: ```javascript const client = new FeatBitClient({ streamingEnabled: true, // Must be true for real-time updates pollingInterval: 30000 // Fallback polling }); ```
  2. Check WebSocket connection: ```javascript client.on('connection', (status) => { console.log('FeatBit connection status:', status); }); ```
  3. Verify Redis Pub/Sub is working between API instances
  4. Clear SDK cache: ```javascript await client.reinitialize(); ```

High Latency Issues

Problem: Flag evaluation takes too long

Solutions:

  1. Enable SDK caching: ```javascript // Client-side SDK caches flags locally // Server-side SDK keeps flags in memory ```
  2. Reduce polling interval for server SDKs: ```javascript const client = new FeatBitClient({ pollingInterval: 60000 // Poll every 60 seconds instead of default }); ```
  3. Optimize targeting rules: - Simplify complex rules - Reduce number of conditions - Use segments instead of repeated conditions
  4. Scale FeatBit API horizontally: - Deploy multiple API instances - Use load balancer - Scale MongoDB/Redis if needed

CORS Errors in Browser

Problem: Browser blocks API requests due to CORS

Solution:

Terminal window
# Update CORS__Origins to include all UI domains
CORS__Origins=https://featbit-ui.klutch.sh,https://app.yourdomain.com,http://localhost:8081
# Redeploy API with updated environment variable

SDK Key Issues

Problem: “Invalid SDK key” error

Solutions:

  1. Verify you're using correct SDK key type: - **Client-side keys**: Start with `client-` (for browser/mobile) - **Server-side keys**: Start with `server-` (for backend)
  2. Check environment matches SDK key: - Development SDK key only works in dev environment - Production SDK key only works in production environment
  3. Generate new SDK key if compromised: - Navigate to environment settings - Click **"Generate New SDK Key"** - Update applications with new key

Additional Resources


With FeatBit deployed on Klutch.sh, you have complete control over your feature flag infrastructure. Start with simple boolean flags, then progress to sophisticated experiments, gradual rollouts, and data-driven feature development. The combination of FeatBit’s powerful feature management and Klutch.sh’s reliable infrastructure gives your team the foundation for confident, controlled deployments.