Docs / Capability guide
DemandAttachment extension
Choose which eligible demand candidates attach to the rendered carrier ad.
All capabilities · Related guide · Agent prompt for this capability
When to use this example
Use this kind when your placement and partner agreements support non-rendered demand attachments and you need your own selection policy. The policy chooses from candidates the host already supplied, subject to attachment limits.
What the example gives you
The starter ranks eligible candidates by net price and returns existing bid IDs within its partner, floor, count and timing constraints. Its tests exercise selection locally; installation alone does not enable attachment or establish billing terms.
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
Extract the archive and follow README.md for setup, commands, and expected results. Start with go run . -kind demand_attachment -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
Run go test -race ./... in the downloaded starter, then start -kind demand_attachment. Read the corresponding fixture and configure the policy before testing live requests.
DemandAttachment uses ExtensionService Describe, Health and Invoke with method Pick. Select eligible candidates supplied by the host alongside the carrier. Return their IDs in attachment_bid_ids.
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.