Summary
Add support for the sdk-spec before-send-hook behavior to the PHP SDK.
Spec
sdk-specs/openspec/specs/before-send-hook/spec.md
Current evidence
The SDK audit found no before_send / beforeSend option or callback path in PostHog::init, Client, README, or tests.
Expected behavior
- Allow configuring a before-send hook for events before enqueue/send.
- Hook can mutate the assembled event.
- Hook can drop the event by returning
null/equivalent.
- Hook exceptions should not crash caller code.
- Add tests covering mutation, drop, and exception handling.
Summary
Add support for the sdk-spec
before-send-hookbehavior to the PHP SDK.Spec
sdk-specs/openspec/specs/before-send-hook/spec.mdCurrent evidence
The SDK audit found no
before_send/beforeSendoption or callback path inPostHog::init,Client, README, or tests.Expected behavior
null/equivalent.