Skip to main content

Feature Flag Overrides

note

Usually referred to online as feature flags, the Statsig UI and SDKs call them feature gates.

Override results of a feature gate

During development, it can be useful to explicitly state which users should pass or fail a given feature gate. This is where overrides come in.

Overrides are based of user IDs and can be set to pass or fail for a given user ID. During evaluation of a gate, if the user ID is overridden, the overridden result will be returned immediately before any rules are evaluated.

Adding an Override

  • Log into the Statsig console at https://console.statsig.com
  • On the left-hand navigation panel, select Feature Gates
  • Select the feature gate where you want to add an Override
  • Click the Add Override button

image-add-overrides

  • Select either 'Pass List' or 'Fail List' from the tabs in the dialog

image-manage-overrides-dialog

  • For users you want to pass the gate, add them to the 'Pass List'

  • For users you want to fail the gate, add them to the 'Fail List'

    Note

    A user can only exist on one of these lists at a time.

  • Once you have added the user IDs, hit Save

Deleting an Override

If you add an override but later decide it is no longer needed. You can remove it so the rules will be evaluated as normal.

  • Log into the Statsig console at https://console.statsig.com
  • On the left-hand navigation panel, select Feature Gates
  • Select the feature gate where you want to add an Override
  • Click the Edit Overrides button

Screen Shot 2022-01-06 at 3 27 43 PM

  • Hit the trashcan icon next to the user ID you wish to remove from a list.

    image-remove-override

  • Once you have updated the lists, hit Save

Testing an Override

Once your override has been added, you can test it in the "Test Gate" window by simply adding userID as a property of the user object.

image-testing-gates

Users that pass will see "PASS (User ID Override)"

image-pass-gate

Users that fail will see "FAIL (User ID Override)"

image-failed-gate