Get flags config
The GET/config endpoint allows you to retrieve all active flag's configurations at once, making it possible to then evaluate an extremely high number of flags locally without doing any API calls.
Getting the configuration
The response is a JSON array containing all active flags. All inactive or archived flags are not present in the response.
Each element of the array is a Flag
object as defined in tggl-core, with an additional slug
key.
Evaluating flags
Once the configuration is retrieved, you should be able to evaluate flags locally without doing any API calls. You can refer to the reference TypeScript implementation in tggl-core.
To test that your implementation is correct, you can copy the standard_tests.json file in your project. It contains an array of 594 tests that you can run against your implementation. The included tests look like this:
Each test has 4 keys:
name
: the name of the testflag
: the flag to evaluate as the API would return itcontext
: the context to evaluate the flag againstexpected
: the expected result of the evaluation
You can then run the tests against your implementation in an automated way. See TypeScript or PHP examples.
Error handling
If you API key is invalid or missing, you will receive a 401 Unauthorized response.