smartling-webhooks

Library for verifying signed Smartling webhooks

Usage no npm install needed!

<script type="module">
  import smartlingWebhooks from 'https://cdn.skypack.dev/smartling-webhooks';
</script>

README

smartling-webhooks

npm npm

Library for verifying signed Smartling webhooks

Installation

npm i smartling-webhooks

Use

isAuthenticGetRequest() returns a boolean indicating Smartling webhook GET callback authenticity

/**
 * @param {string} callbackUrl - callback url with query parameters
 * @param {string} headerSignature - value of X-Smartling-Signature header
 * @param {string} SECRET_KEY - signed request secretKey
 */

isAuthenticPostRequest() returns a boolean indicating Smartling webhook POST body authenticity

/**
 * @param {object} postBody - POST request body
 * @param {string} headerSignature - value of X-Smartling-Signature header
 * @param {string} SECRET_KEY - signed request secretKey
 */

Documentation

https://help.smartling.com/hc/en-us/articles/360007829194-Callbacks-and-Webhooks