@sanity/webhook
Advanced tools
Changelog
4.0.0 (2023-11-27)
Replace the Node.js crypto
API with the Web Crypto API,
enabling usage in more environments. All assertion/checking functions are
now async, eg return Promises instead of straight booleans.
Only Node.js version 18 and higher is now supported.
feat: add tsdoc for all exported members
test: only test on lts node.js engines
Changelog
2.0.0
requireSignedRequest()
, assertValidRequest()
and isValidRequest()
methods now require a body in string/buffer format, and will throw an error if it is already parsed. This is due to potential signature mismatches when re-encoding JSON. See the migration docs for more information.Changelog
1.1.0
requireSignedRequest()
method now takes an additional option - parseBody
. By default, it is set to true
, and will parse the incoming JSON request and assign it to request.body
. If set to false
, the body is left untouched and has to be parsed by the user.