Skip to content

Instantly share code, notes, and snippets.

@enricop89
Created April 3, 2019 14:39
Show Gist options
  • Save enricop89/750536b66b969f67335126395acb7b08 to your computer and use it in GitHub Desktop.
Save enricop89/750536b66b969f67335126395acb7b08 to your computer and use it in GitHub Desktop.
How to compute bandyer signature in Webhook Methods
const crypto = require('crypto');
const data = {
event: "on_message_sent",
"event_version": "0.1",
"namespace": "chat",
"data": "{}"
}
const secret = 'ak_fake_123456789';
const timestamp = '1554297654628';
const bandyerSignature = crypto.createHmac('sha256', secret).update(`${timestamp}.${data}`).digest('hex'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment