Cryptographically signed webhooks for Stripe, Paddle, Polar, and custom backends
Attach the lightweight browser snapshot returned by window.trimstats.attribution() to checkout metadata. When payment settles, TrimStats verifies the provider signature and records the transaction in ClickHouse.
- Verifies stripe-signature, paddle-signature, Standard Webhooks (Polar), and custom HMAC headers.
- Webhook signing secrets are stored encrypted at rest in PostgreSQL.
- Falls back gracefully to checkout metadata even when a visitor browsed in strict cookie-less mode.
1const attribution = window.trimstats?.attribution?.() ?? {};23await fetch('/api/checkout', {4 method: 'POST',5 headers: { 'content-type': 'application/json' },6 body: JSON.stringify({ priceId: 'price_growth_monthly', attribution }),7});


