Prerequisites

  • Channel Secret: A secret key given by Abbie Platform

Validate X-Abbie-Signature

When you receive a webhook request from Abbie Platform, you can validate the request by calculating the signature and comparing it with the signature value in the X-Abbie-Signature header.

const crypto = require('crypto')
const channelSecret = '...' // Channel secret string
const body = '...' // Request body string

const signature = crypto.createHmac('SHA256', channelSecret).update(body).digest('base64')

Compare the signature you received with the signature value in the X-Abbie-Signature header. If they match, it means that the webhook request was sent from Abbie Platform.