Docs / Capability guide

AudienceEvaluator extension

Evaluate an audience using your own matching rule.

All capabilities · Related guide · Agent prompt for this capability

When to use this example

Use an AudienceEvaluator when an audience needs a matching rule beyond the standard configuration. Testing known inputs locally helps explain why a request should pass before the rule participates in live targeting.

What the example gives you

The starter matches a configured country or an existing segment prefix and returns pass and matched values. It reads process configuration; adapting it to per-audience rules requires implementing and testing rules_json handling.

Before you start

Go for local tests. Host installation also requires a supported kind, reachable gRPC address, matching descriptor/entitlement and an installed stack product. Read the packaged README for policy configuration.

Run the example

Download extension-sidecar

Extract the archive and follow README.md for setup, commands, and expected results. Start with go run . -kind audience_evaluator -addr 127.0.0.1:50051. Local tests use sample data.

Follow the archive's service configuration and deployment steps before registering or installing it in Riptide. The prerequisites above describe the access and connectivity it needs.

Connect it to your application

  1. Run go test -race ./... in the downloaded starter, then start -kind audience_evaluator. Read the corresponding fixture and configure the policy before testing live requests.

  2. AudienceEvaluator uses ExtensionService Describe, Health and Invoke with method Evaluate. Evaluate the host-provided audience against allowed signals. Keep pass/matched output consistent and cover positive, negative and consent-denied requests.

  3. Run the gRPC smoke tests, then install using the stack-product workflow. Verify timeout and fallback behavior and remove the activation to test rollback.

Check the result

The descriptor matches the selected kind, gRPC calls return the documented result, and malformed/unsupported requests fail explicitly. A host timeout skips the extension within the request budget.

API operations