Flagsmith

repository·main·Indexed 11 days ago

https://github.com/Flagsmith/flagsmith

An open-source feature flagging, remote configuration, and A/B testing platform. It allows developers to control feature rollouts, segment users, and manage releases without redeploying code. The platform consists of a Django-based API (version 2.68.0), a TypeScript React frontend, and an MCP server.

Tokens
181.3K
Snippets
382
Records
794
Agent score
90%

What's inside Flagsmith

  1. Flagsmith vulnerability scanning methods

    main

    Flagsmith uses continuous, automated scanning to secure its supply chain:

    • Trivy: Scans Docker images every 3 hours; results are reported via SARIF to GitHub's security tab.
    • Renovate: Monitors Python, Node.js, and documentation dependencies in security-only mode (raises PRs only for known vulnerabilities).
    • Docker Scout: Provides additional image-level security analysis.
    • Base OS: Docker images use Chainguard Wolfi to reduce the attack surface.
  2. Connect AI assistants to Flagsmith via MCP Server

    main

    The Flagsmith MCP Server allows AI assistants and agents to programmatically manage feature flags, segments, multivariate options, and release workflows using the Model Context Protocol (MCP).

    Deployment Options

    • Flagsmith SaaS (cloud): Use the remote HTTP URL https://mcp.flagsmith.com. No installation is required.
    • Self-hosted / private cloud: Use your specific MCP server base URL. You must run the MCP server as part of your own deployment.

    Connection Methods

    • Remote (Streamable HTTP): Connect your client directly to the MCP URL. This is the easiest method for SaaS users.
    • Local (stdio): Run the server as a local subprocess using uvx. This is useful for local development or when using clients that prefer stdio. Note that stdio requires an API key for authentication as it does not support interactive OAuth.
  3. Configure Platform and Monitor Usage

    main

    Manage the deployment and monitor the health of your Flagsmith instance:

    • Environment Settings: Configure environment-level options and specific configurations.
    • Platform Metrics: Monitor system performance and health via platform metrics.
    • API Usage & Monitoring: Track and analyze API usage, which is useful for both performance monitoring and billing analysis.
  4. Core Features of Flagsmith

    main

    Flagsmith is a feature flagging, remote configuration, and A/B testing platform. Key capabilities include:

    • Feature Flags: Wrap code sections in flags to release features safely and toggle them without new deployments.
    • Remote Configuration: Change application behavior remotely.
    • A/B Testing: Use segments to run multivariate tests on new features.
    • Segments: Target specific user groups (e.g., beta testers) for feature rollouts.
    • Organisation Management: Manage teams using organisations, projects, and roles.
    • SDK Support: Over 15 languages supported (including TypeScript, .NET, Java) and frameworks (React, Next.js).
  5. Ensure Governance and Compliance

    main

    Flagsmith provides tools to meet organizational governance and compliance standards:

    • Security Controls: Access platform security settings and follow best practices to secure your environment.
    • Audit & Compliance: Use audit logs to track changes and user access for compliance auditing purposes.
    • System Limits: Monitor platform limits and request overrides when necessary.
  6. Available Client-Side SDKs for Flagsmith

    main

    Flagsmith provides several client-side SDKs designed to evaluate feature flags directly on the user's device in browser, mobile, or other client-side environments.

    Supported platforms include:

    • Web: JavaScript and React
    • Next.js: Specialized support for Next.js applications using Server-Side Rendering (SSR)
    • Mobile: Android, iOS, and Flutter

    Each SDK is optimized for its specific environment to provide features like real-time updates, local evaluation (where supported), trait management, and analytics integration.

  7. Manage Access Control and Authentication in Flagsmith

    main

    Administrators can control how users access the Flagsmith platform through several mechanisms:

    • User Management & Permissions: Control user roles, groups, and fine-grained permissions via Role-Based Access Control (RBAC).
    • Authentication Management: Configure various authentication methods, including Single Sign-On (SSO), SAML, LDAP, and Two-Factor Authentication (2FA).
    • Enterprise SSO: Integrate with enterprise identity providers such as SAML, Okta, LDAP, and Microsoft ADFS.
  8. What is the Flagsmith Edge Proxy?

    main

    The Flagsmith Edge Proxy is a self-hosted, lightweight Docker container designed to reduce latency and API load. It acts as a local cache and an API interface compatible with the Flagsmith SDK API.

    Key Benefits

    • Reduced API Load: It reduces the number of polling requests made against the main Flagsmith API (either hosted or self-hosted).
    • Low Latency: By running the proxy close to your servers/infrastructure, you can serve a high volume of requests with minimal delay.
    • Scalability: The proxy is stateless, making it highly scalable when deployed behind a load balancer.

    Comparison of Low-Latency Options

    If you need low-latency flags in a server-side environment, you have two primary choices:

    1. Run the Edge Proxy: Host the proxy in your own infrastructure and point your server-side SDKs to it.
    2. Local Evaluation Mode: Run your server-side SDKs directly in Local Evaluation Mode, which provides the lowest possible latency by eliminating the network hop to a proxy entirely.
  9. What is Remote Config?

    main

    Remote Config allows you to return typed values—such as string, number, boolean, or JSON—alongside the standard on/off state of a feature flag.

    Instead of just enabling or disabling a feature, you can use Remote Config to tweak behavior, thresholds, UI copy, or layouts dynamically without requiring a code deployment. SDKs evaluate these values using the same targeting and rollout rules applied to standard feature flags.

  10. How multivariate flags (A/B/n) work

    main

    Multivariate flags allow you to define multiple variants with percentage weightings.

    Key Concepts:

    • Identity Requirement: Bucketing is calculated per identity. You must identify users (via an ID or a generated GUID/UUID) to ensure they receive a consistent variant.
    • Deterministic Bucketing: The same identity will receive the same variant within a specific environment unless weights are changed.
    • Weight Stability: Changing weights during a live test will re-bucket users. Avoid changing weights mid-test unless you intend to reshuffle the population.
    • Environment Independence: Identity bucketing is independent per environment; a user might land in different variants across different environments.
    • SDK Usage: The SDK returns both the boolean enabled state and the multivariate value. Use the value to drive your application's branching logic.

    Quick Setup Checklist:

    1. Define variants and weights (must sum to 100% and have at least two variants).
    2. Enable the flag.
    3. Identify the user (or provide an anonymous GUID) before fetching flags.
    4. Use the value property in your code for logic.
    5. Enable analytics integrations to track results.