verifyWebhook = req => {
  const signature = {
    signingSecret: process.env.SLACK_SECRET,
    requestSignature: req.headers['x-slack-signature'],
    requestTimestamp: req.headers['x-slack-request-timestamp'],
    body: req.rawBody,
  };

  // This method throws an exception if an incoming request is invalid.
  verifyRequestSignature(signature);
}
Verify that the webhook request came from Slack.

@param {object} req Cloud Function request object.
@param {string} req.headers Headers Slack SDK uses to authenticate request.
@param {string} req.rawBody Raw body of webhook request to check signature against.