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.

Early Access

This policy is in private beta. If you would like to use this please reach out to us: whatzup@zuplo.com

Configuration

{
"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

      • export

        Specifies the export to load your function, e.g. default, myFunction.

      • module

        Specifies the module to load your function, in the format $import(./modules/my-module)

Read more about how policies work