OptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalonOptionalwebhookReceiver-side deduplication of webhook payloads by idempotency_key.
AdCP webhooks use at-least-once delivery — publishers retry until they
see a 2xx, so the same event may arrive more than once. When configured,
the first delivery for a given (agent_id, idempotency_key) tuple
dispatches to handlers; subsequent deliveries are dropped and surface
as a webhook_duplicate activity.
Reuses IdempotencyBackend from @adcp/sdk/server — you can share
the same backend across request-side and webhook-side dedup, or use a
dedicated one. Scope is per-agent so keys from different senders are
independent, matching the spec's "scoped to authenticated sender
identity" rule.
Custom backends must implement atomic putIfAbsent(),
replaceIfPayloadHash(), replaceIfPayloadHashAndExpired(), and
deleteIfPayloadHash() operations.
Every delivery without idempotency_key, and every malformed present
key, fails before handler dispatch. Older A2A senders that cannot emit
the field must leave dedup disabled rather than silently bypassing it.
OptionalttlSeconds?: numberRetention for dedup keys. Defaults to 86_400 (24h).
OptionalinFlightTtlSeconds?: numberOptional renewable processing-claim lease.
By default, an in-progress claim uses the full ttlSeconds retention
window. That durable fence prioritizes duplicate-side-effect safety if
a backend renewal fails while an unconstrained application handler is
still running. Setting a shorter value explicitly opts into automatic
crash recovery after that lease. Because generic handlers cannot be
cancelled or transactionally fenced by this SDK, handlers used with a
shorter lease MUST make their own side effects idempotent.
Must not exceed ttlSeconds (or its 86,400-second default), because a
processing claim cannot outlive the webhook's deduplication fence.
Optionalon
Configuration for async handler with typed callbacks