Skip to content

open-feature/flagd

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Feb 4, 2025
Jan 31, 2025
Mar 1, 2025
Feb 25, 2025
Mar 1, 2025
Mar 1, 2025
Jun 19, 2023
Jan 7, 2025
Apr 9, 2024
Jan 31, 2025
Mar 9, 2023
Dec 11, 2024
Jan 26, 2023
Dec 11, 2024
Nov 19, 2024
Sep 23, 2024
Jan 7, 2025
Nov 2, 2023
Jan 31, 2023
Oct 30, 2024
Jan 3, 2024
Aug 21, 2023
Feb 21, 2025
Mar 9, 2023
Mar 23, 2023
Aug 8, 2023
Sep 23, 2024
May 26, 2022
Jan 7, 2025
Mar 7, 2024
Feb 21, 2025
Oct 28, 2024
Dec 4, 2023
Dec 29, 2024
Oct 28, 2024
Aug 4, 2023

Repository files navigation

A feature flag daemon with a Unix philosophy.

Github Actions

What's flagd?

flagd is a feature flag daemon with a Unix philosophy. Think of it as a ready-made, open source, OpenFeature-compliant feature flag backend system.

Features

▢️ Quick Start

Experiment with flagd in your browser using the Killercoda tutorial or follow the instructions below to run on your own infrastructure.

  1. flagd can be run as a standalone binary or container. Download and install flagd or run it as a container

    Kubernetes-native? flagd can also be run as part of the Kubernetes Operator.

  2. Start flagd:

    flagd start \
      --port 8013 \
      --uri https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json

    Or use docker: Note - In Windows, use WSL system for both the file location and Docker runtime. Mixed file systems don't work and this is a limitation of Docker

    docker run \
      --rm -it \
      --name flagd \
      -p 8013:8013 \
      ghcr.io/open-feature/flagd:latest start \
      --uri https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json

    If you wish, download the file locally to make changes:

    wget https://raw.githubusercontent.com/open-feature/flagd/main/samples/example_flags.flagd.json

    In local mode, run flagd like this:

    flagd start \
      --port 8013 \
      --uri file:./example_flags.flagd.json

    Or use docker ( Note - In Windows, this requires WSL system for both the file location and Docker runtime):

    docker run \
      --rm -it \
      --name flagd \
      -p 8013:8013 \
      -v $(pwd):/etc/flagd \
      ghcr.io/open-feature/flagd:latest start \
      --uri file:./etc/flagd/example_flags.flagd.json

    --uri can be a local file or any remote endpoint. Use file: prefix for local files. eg. --uri file:/path/to/example_flags.flagd.json. gRPC and http have their own requirements. More information can be found here.

    Multiple --uri parameters can be specified. In other words, flagd can retrieve flags from multiple sources simultaneously.

  3. Flagd is now ready to perform flag evaluations over either HTTP(s) or gRPC. This example utilizes HTTP via cURL.

    Retrieve a String value:

    curl -X POST "http://localhost:8013/flagd.evaluation.v1.Service/ResolveString" \
      -d '{"flagKey":"myStringFlag","context":{}}' -H "Content-Type: application/json"

    For Windows we recommend using a WSL terminal. Otherwise, use the following with cmd:

    set json={"flagKey":"myStringFlag","context":{}}
    curl -i -X POST -H "Content-Type: application/json" -d %json:"=\"% "localhost:8013/flagd.evaluation.v1.Service/ResolveString"

    Result:

    {
      "value": "val1",
      "reason": "DEFAULT",
      "variant":"key1"
    }

    Updates to the underlying flag store (e.g. JSON file) are reflected by flagd in realtime. No restart is required.

    flagd also supports boolean, integer, float and object flag types.

  4. Now that flagd is running, it is time to integrate it into your application. Do this by using an OpenFeature provider in a language of your choice.

πŸ“ High-level Architecture

logical architecture of flagd

πŸ“ Further Documentation

Further documentation including flagd configuration options, fractional evaluation, targeting rules and flag configuration merging strategies can be found at flagd.dev or in this repository.

🫢 Contributing

Interested in contributing? Great, we'd love your help! To get started, take a look at the CONTRIBUTING guide.

We also hold regular community meetings that are open to everyone. Check the OpenFeature community page for all the ways to get involved.

Thanks so much to our contributors.

Made with contrib.rocks.

License

Apache License 2.0