Skip to content

Commit 352ec15

Browse files
committed
chore: remove webhook signature verification example from README
1 parent a5b677b commit 352ec15

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

README.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ If you are looking to integrate file uploads in browsers, use one of our [fronte
2727
- [Using Raw parameter for custom transformations](#using-raw-parameter-for-custom-transformations)
2828
- [Authentication parameters for client-side uploads](#authentication-parameters-for-client-side-uploads)
2929
- [Webhook verification](#webhook-verification)
30-
- [Verifying webhook signatures](#verifying-webhook-signatures)
3130
- [Handling errors](#handling-errors)
3231
- [Retries](#retries)
3332
- [Timeouts](#timeouts)
@@ -353,35 +352,6 @@ These authentication parameters can be used in client-side upload forms to secur
353352

354353
The ImageKit SDK provides utilities to verify webhook signatures for secure event handling. This ensures that webhook requests are actually coming from ImageKit and haven't been tampered with.
355354

356-
### Verifying webhook signatures
357-
358-
```ts
359-
import ImageKit from '@imagekit/nodejs';
360-
361-
const client = new ImageKit({
362-
privateKey: process.env['IMAGEKIT_PRIVATE_KEY'],
363-
webhookSecret: process.env['IMAGEKIT_WEBHOOK_SECRET'], // Required for webhook verification
364-
});
365-
366-
try {
367-
// Verify and unwrap webhook payload
368-
const event = client.webhooks.unwrap(
369-
webhookBody, // Raw webhook payload (string)
370-
{
371-
headers: webhookHeaders, // Request headers containing signature
372-
},
373-
);
374-
375-
console.log('Webhook signature is valid');
376-
console.log('Event type:', event.type);
377-
console.log('Event data:', event.data);
378-
// Process the webhook event
379-
} catch (error) {
380-
console.log('Invalid webhook signature or malformed payload');
381-
// Reject the request
382-
}
383-
```
384-
385355
For detailed information about webhook setup, signature verification, and handling different webhook events, refer to the [ImageKit webhook documentation](https://imagekit.io/docs/webhooks#verify-webhook-signature).
386356

387357
## Handling errors

0 commit comments

Comments
 (0)