• Stars
    star
    487
  • Rank 89,740 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 20 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A feature flag daemon with a Unix philosophy

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 does not 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/schema.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/schema.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 restarts required.

    flagd also supports boolean, integer, float and object flag types. Read more on the evaluation examples page

  4. Now that flagd is running, it is time to integrate 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 on this page.

🫶 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

More Repositories

1

spec

OpenFeature specification
Python
632
star
2

js-sdk

JavaScript SDK for OpenFeature
TypeScript
134
star
3

go-sdk

Go SDK for OpenFeature
Go
119
star
4

community

OpenFeature project community and governance
JavaScript
91
star
5

java-sdk

Java implementation of the OpenFeature SDK
Java
80
star
6

open-feature-operator

A Kubernetes feature flag operator
Go
76
star
7

playground

OpenFeature SDK demos and experimentation
TypeScript
47
star
8

python-sdk

Python SDK for OpenFeature
Python
41
star
9

go-sdk-contrib

Community maintained OpenFeature Providers and Hooks for Go
Go
41
star
10

js-sdk-contrib

OpenFeature Providers and Hooks for JavaScript
TypeScript
33
star
11

openfeature.dev

OpenFeature Website
TypeScript
31
star
12

rust-sdk

Rust implementation of the OpenFeature SDK
Rust
26
star
13

ruby-sdk

Ruby implementation of the OpenFeature SDK
Ruby
23
star
14

php-sdk

PHP implementation of the OpenFeature SDK
PHP
23
star
15

java-sdk-contrib

Community contributions for hooks and reference providers
Java
22
star
16

dotnet-sdk

.NET implementation of the OpenFeature SDK
C#
18
star
17

ofep

A focal point for OpenFeature research, proposals and requests for comments
14
star
18

watchman

A Kubernetes admission controller driven by open-feature
Go
11
star
19

php-sdk-contrib

OpenFeature Providers and Hooks for PHP
PHP
10
star
20

python-sdk-contrib

Community contributions for hooks and reference providers in python
Python
8
star
21

docs.openfeature.dev

OpenFeature Documentation
TypeScript
6
star
22

flagd-schemas

Schemas and spec files pertaining to flagd
Makefile
6
star
23

feature-operator

OpenFeature Operator for Kubernetes
Go
5
star
24

killercoda

Killercoda Interactive Examples for OpenFeature
Shell
5
star
25

dotnet-sdk-contrib

OpenFeature Providers and Hooks for .NET
C#
5
star
26

flagd-testbed

Shared test harness for flagd SDK testing, with Gherkin tests
Go
4
star
27

.github

This repository stores various defaults for the GitHub organization
3
star
28

kubecon-eu-2024-demo

TypeScript
3
star
29

ruby-sdk-contrib

Community contributions for hooks and reference providers in Ruby
Ruby
2
star
30

feature-evaluation-api

Makefile
2
star
31

cloud-native-demo

A cloud-native feature flag demo, featuring multiple providers, telemetry, and a guided tour
Makefile
2
star
32

open-feature.github.io

OpenFeature website
CSS
2
star