Abyss Storage
  • Abyss Storage
  • Setup
    • Core
    • File Management
    • Webhook
    • Thumbnails
    • Bucket
    • Collection
  • About
    • Links
Powered by GitBook
On this page
  • Validate Webhook Signature
  • Webhook failure
  1. Setup

Webhook

PreviousFile ManagementNextThumbnails

Last updated 8 months ago

Abyss Storage can notify you when someone use your PreSignUrl.

Before using Webhook, you have to configure it from the Storage dashboard of your application.

Validate Webhook Signature

To secure the Webhook origin, every webhook are signed using an HMAC signature.

You can copy and reset your signature secret from the Dashboard interface.

const headerSignature = req.headers[HEADER_SIGNATURE_NAME];

const hmac = crypto.createHmac(
  SIGNATURE_ALGORITHM,
  "my-secret-signature",
);
const signature = hmac.update(JSON.stringify(req.body)).digest('hex');

if (headerSignature !== signature) {
  // Throw an error
  throw new Error('Invalid Signature');
}
// The signature is correct

All typing of webhook content are available on Core Package

Webhook failure

On multiple failure, the webhook will automatically be disabled. You can turn it on at any time from your dashboard. You will get notified and you can check the Webhook History to debug it.

Dashboard Webhooks Management