fix: accept Plausible tracker's compact event keys in proxy #32
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/plausible-event-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Every request to
/api/plausible/eventreturned400 Invalid event, so Plausible has recorded nothing through the proxy (pageviews included).The validator required a string
name, but Plausible's tracker script sends compact keys —{"n":"pageview","u":...,"d":"fliary.com"}.Fix
Accept either
n(tracker script) orname(documented Events API). Still rejects non-objects/arrays, malformed JSON, and bodies over 2 KB.Verify
After deploy,
pageview/engagementPOSTs to/api/plausible/eventshould return202, and visits should appear in Plausible.🤖 Generated with Claude Code