File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,6 +84,30 @@ curl -X POST https://<your-worker>.workers.dev/capture \
8484 ]'
8585```
8686
87+ ## HMAC signing (optional)
88+
89+ If ` POSTHOG_SIGNING_SECRET ` is set, requests must include a valid signature.
90+
91+ ``` bash
92+ payload=' [
93+ {
94+ "api_key": "phc_example",
95+ "event": "purchase",
96+ "distinct_id": "user_12345",
97+ "properties": { "amount": 29.99 }
98+ }
99+ ]'
100+
101+ signature=$( printf ' %s' " $payload " | openssl dgst -sha256 -hmac " $POSTHOG_SIGNING_SECRET " | awk ' {print $2}' )
102+
103+ curl -X POST https://< your-worker> .workers.dev/capture \
104+ -H " Content-Type: application/json" \
105+ -H " X-POSTHOG-SIGNATURE: sha256=$signature " \
106+ -d " $payload "
107+ ```
108+
109+ Note: ` X-HUB-SIGNATURE ` with ` sha1= ` is also accepted for GitHub-style webhook compatibility.
110+
87111## PostHog SDK config
88112
89113### Browser (posthog-js)
You can’t perform that action at this time.
0 commit comments