Each request is signed in the Relay-Signature header: an HMAC SHA-256 of the raw body.
import { createHmac, timingSafeEqual } from "node:crypto";
const given = request.headers.get("relay-signature") ?? "";
const expected = createHmac("sha256", process.env.WEBHOOK_SECRET)
.update(rawBody)
.digest("hex");
const valid =
given.length === expected.length &&
timingSafeEqual(Buffer.from(given), Buffer.from(expected));Couldn't rotate. The old secret still works.
are not in the sample request.
Write release notes for the deploy of storefront from main. Start from this commit: Cache the cart drawer between routes