Token sources
The worker accepts the token from either of these locations, in this order:X-Storefront-Access-Tokenheadertokenquery string parameter
401 Unauthenticated.
Header (preferred)
Use the header form whenever you control request headers — typically server-to-server calls, or browserfetch calls where you don’t need sendBeacon.
Query parameter (for navigator.sendBeacon)
navigator.sendBeacon does not let you set custom headers. Pass the token in the query string instead:
Errors
Per-event validation errors do not return
422. Invalid events inside a valid batch are skipped silently so the rest of the batch still ingests.
CORS
The endpoint reflects the requestOrigin header and allows credentials, so it works from any browser origin you’ve authorized via your storefront token’s allowed domains.