Flags API

The Flags API is what your system interacts within to determine which feature flags are enabled for a given context. You can use an SDK if there is one avaiable for your programming language of choice. It should be trivial to support other programming languages or use your own implementation.


Infrastructure

The Flags API is written in Python 3.12 and runs on FastAPI.


Dependencies

The only external dependency for the Flags API is Redis Cluster. Redis Cluser stores cached data related to projects and feature flags.


API

To get all feature flags enabled for a given context, you can use the following endpoint:

POST /feature_flags

Body

The POST body should contain the context data in JSON format. The keys should match the field keys of context fields you have created for your Flagship project. The values should match the value types of those context fields.

Query Parameters

  • project_id
    • You can find this from the Flagship UI.
  • user_key
    • This is how you uniquely identify your users.
    • For example, this could be a UUID or numeric user ID.

Headers

  • FLAGSHIP-SIGNATURE
    • This is how Flags API requests are authenticated.
    • This can be generated by an SDK.
    • It is an HMAC signature based on the project's private key and the user key.

Installation

You can use the following Docker image from Dockerhub:

alexschimpf/flagship-flags:latest

You can read more about configuring this server in Installation.