Skip to main content

A/B Test Inbound Policy

The A/B test policy is used to handle requests differently based on parameters such as user, ip, etc.

caution

This policy is in private beta. If you would like to use this please reach out to us: [email protected]

Configuration

tip

Be sure to read about policies

{
"name": "my-ab-test-inbound-policy",
"policyType": "ab-test-inbound",
"handler": {
"export": "ABTestInbound",
"module": "$import(@zuplo/runtime)",
"options": {
"testKey": "${user.sub}",
"modifier": {
"module": "$import(./modules/ab-test)",
"export": "abTestModifier"
}
}
}
}
  • name the name of your policy instance. This is used as a reference in your routes.
  • policyType the identifier of the policy. This is used by the Zuplo UI. Value should be ab-test-inbound.
  • handler/export The name of the exported type. Value should be ABTestInbound.
  • handler/module the module containing the policy. Value should be $import(@zuplo/runtime).
  • handler/options The options for this policy:
    • testKey
      The key to use for determining the group the request belongs
    • modifier
      The function that modifies the request based on the test key