Skip to content

Using configuration listeners

Listeners allow dynamic behavior changes without redeployment.

Python

python
def on_flag_change(enabled):
    if enabled:
        enable_checkout_experiment()
    else:
        disable_checkout_experiment()

platform.listen("checkout.experiment.enabled", on_flag_change)

Node.js

js
platform.listen("checkout.experiment.enabled", (enabled) => {
  if (enabled) enableCheckoutExperiment()
  else disableCheckoutExperiment()
})