Push your commits with confidence

Use feature flags that integrate with your development workflow.

Start for free. No credit card required.

Install NOW
> npm install -g @featureninjas/cli
> cd my-project-dir
> fn init
for GitHub users
Control every aspect of your flags using git and GitHub. History, Access Control, Review and more.
for Developers
Add a flag for your new feature. Deliver changes early to be in sync with the master branch always.
for Any framework
No need to use an SDK. Call our simple API or use our CLI tool to access the full functionality.

Examples

API

Use any framework or language to get the current set of feature flags
curl -X GET \
  https://api.featureninjas.com/flags/[account-name]/[repo-name]/[branch_ref_name] \
  -H 'X-FeatureNinjas-Secret: [secret]'

Simple flags

Configure flags in flags.json (default name) using json syntax. string, number, boolean and array are supported out of the box.
Flags
{
  "backupEnabled": true,
  "backupInterval": 10,
  "backupPrefix": "backup-",
  "backupFormats": [
    "csv",
    "xlsx"
  ]
}
GET /flags body
empty
Result
{
  "backupEnabled": true,
  "backupInterval": 10,
  "backupPrefix": "backup-",
  "backupFormats": [
    "csv",
    "xlsx"
  ]
}

Object flags

In order to use objects, gradual rollout strategies and advanced logic, the flag has to be an object itself. "value" is the default attribute to hold the actual flag value. Here you can use any object. Note that FeatureNinjas will always return the evaluated flags. Never the logic behind.
Flags
{
  "logger": {
    "value": {
      "format": "xml",
      "output": [
        "file",
        "console",
        "db"
      ],
      "maxFileSize": 1024
    }
  }
}
GET /flags body
empty
Result
{
  "logger": {
    "format": "xml",
    "output": [
      "file",
      "console",
      "db"
    ],
    "maxFileSize": 1024
  }
}

Simple Rules

Define custom rules to control the values of flags automatically. Define a default value in case the evaluation fails. This is the backup value that will be used in worst case. Rules are based on JsonLogic. The result of the evaluation is the returned flag value. The example shows a condition which returns the value of the flag (true) in case the current date is after January 1st, 2020. Otherwise, the default value (false) is returned.
Flags
{
  "backupEnabled": {
    "default": false,
    "value": true,
    "rules": {
      "if": [
        // condition
        { ">": [{"var": "sys.date"}, "2020-01-01"] },
        // return flag.value in case the condition is true
        {"var": "flag.value"},
        // return flag.default value in case the condition is false
        {"var": "flag.default"}
      ]
    }
  }
}
GET /flags body
empty
Result
{
  "backupEnabled": true
}

Complex Rules

You can provide any value for evaluation when you request your feature flags. Use the request body to send the data and access it using the "cus" variable category.
Flags
{
  "backupEnabled": {
    "default": false,
    "value": true,
    "rules": {
      "if": [
        {"and": [
          {"==": [{"var": "cus.domain"}, "gmail.com"]},
          {"==": [{"var": "cus.plan"}, "pro"]}
        ]},
        {"var": "flag.value"},
        {"var": "flag.default"}
      ]
    }
  }
}
GET /flags body
{
  "domain": "gmail.com",
  "plan": "pro"
}
Result
{
  "backupEnabled": true
}

Join

STARTER

$
0
/ MO
yes
unlimited feature flags
yes
personal GitHub accounts
yes
'master' branch only
yes
advanced rules
yes
rollout strategies
yes
docker image

PRO

$
49
/ MO
14 days trial
yes
unlimited feature flags
yes
any GitHub account
yes
any branch
yes
advanced rules
yes
rollout strategies
yes
docker image

BUSINESS

$
999
/ MO
14 days trial
yes
unlimited feature flags
yes
any GitHub account
yes
any branch
yes
advanced rules
yes
rollout strategies
yes
docker image
twitter facebook
FeatureNinjas OÜ
Sepapaja 6
11415 Tallinn
Estonia
Product
Docs Roadmap GitHub