Skip to content

Commit e3f6cbb

Browse files
committed
docs(webhooks): clarify webhook signature validation (#17)
1 parent c0d6488 commit e3f6cbb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ while (page != null) {
276276

277277
We provide helper methods for verifying that a webhook request came from Lithic, and not a malicious third party.
278278

279-
You can use `lithic.webhooks().verifySignature(body, headers, secret?)` or `lithic.webhooks().unwrap(body, headers, secret?)`.
279+
You can use `lithic.webhooks().verifySignature(body, headers, secret?)` or `lithic.webhooks().unwrap(body, headers, secret?)`,
280+
both of which will raise an error if the signature is invalid.
281+
282+
Note that the "body" parameter must be the raw JSON string sent from the server (do not parse it first).
283+
The `.unwrap()` method can parse this JSON for you.
280284

281285
---
282286

0 commit comments

Comments
 (0)