You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/destinations/catalog/webhooks/index.md
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -217,6 +217,24 @@ if (signature === digest) {
217
217
}
218
218
```
219
219
220
+
For Batch events, the process to authenticate these requests slightly differs as it involves verifying the X-Signature header against a hash of the *first event* in the batch.
221
+
222
+
An example of how you might authenticate batch requests would be:
223
+
224
+
```javascript
225
+
constsignature=req.headers['x-signature'];
226
+
constdigest= crypto
227
+
.createHmac('sha1', 'sharedsecretvalue')
228
+
.update(JSON.stringify(req.body[0]),'utf-8')
229
+
.digest('hex');
230
+
231
+
if (signature === digest) {
232
+
233
+
// do cool stuff
234
+
235
+
}
236
+
```
237
+
220
238
### SSL Certification
221
239
222
240
If your server is using HTTPS, note that our webhooks destination does not work with self-signed certs. If webhooks detects a self-signed cert it will throw an error and no request will be sent.
0 commit comments