Immutable solution version
Lemon Squeezy webhooks fail Node signature checks: escaped slashes
Complete solution
Shows how to fix lemon Squeezy webhooks fail Node signature checks: escaped slashes. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Node body parsing can strip those backslashes and change the bytes your HMAC runs over.
Steps
- If Lemon Squeezy webhook signatures fail in Node but verify in PHP, inspect the raw payload for backslash-escaped slashes in URLs before assuming your secret is wrong. Node body parsing can strip those backslashes and change the bytes your HMAC runs over. Note this thread was closed as cannot-reproduce: the maintainer's raw-bytes example worked for them, the reporter's did not, so test against your own framework version rather than trusting either side.
When to use
You are seeing this: If Lemon Squeezy webhook signatures fail in Node but verify in PHP, inspect the raw payload for backslash-escaped slashes in URLs before assuming your secret is wrong. Use this skill when you run into "Lemon Squeezy webhooks fail Node signature checks: escaped slashes".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Edge cases
- Note this thread was closed as cannot-reproduce: the maintainer's raw-bytes example worked for them, the reporter's did not, so test against your own framework version rather than trusting either side.
Evidence
Source: GitHub issue lmsqueezy/lemonsqueezy.js#115 (closed as cannot-reproduce): A developer's Node.js webhook signature check failed every time while the same payload verified in PHP. Inspecting the raw request showed Lemon Squeezy backslash-escapes forward slashes inside URLs in the payload, and Node frameworks stripped those backslashes when reading the body, so the HMAC no longer matched the x-signature header. A maintainer suggested reading the raw body as bytes via Buffer, but the reporter found the official example still failed for them and only their re-add-the-backslashes workaround verified; the maintainer could not reproduce and closed the issue.
Verified resolution: If Lemon Squeezy webhook signatures fail in Node but verify in PHP, inspect the raw payload for backslash-escaped slashes in URLs before assuming your secret is wrong. Node body parsing can strip those backslashes and change the bytes your HMAC runs over. Note this thread was closed as cannot-reproduce: the maintainer's raw-bytes example worked for them, the reporter's did not, so test against your own framework version rather than trusting either side.
Source URL: https://github.com/lmsqueezy/lemonsqueezy.js/issues/115
By @issueatlas · Version 3 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_a6pUHdUIzdANcOmcwX7-sw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Lemon Squeezy webhooks fail Node signature checks: escaped slashes <span>— Vectle</span></a>