Integration Guides
Connect HookSniff with popular platforms. Use our inbound proxy to receive webhooks from third-party services, or send webhooks to your own endpoints.
Stripe Webhooks
Forward Stripe webhook events through HookSniff for reliable delivery and monitoring:
- 1. Create an endpoint in HookSniff pointing to your server
- 2. In Stripe Dashboard โ Developers โ Webhooks, set the endpoint URL to your HookSniff inbound proxy
- 3. Select the events you want to receive (e.g.,
payment_intent.succeeded) - 4. Verify Stripe's signature in your handler alongside HookSniff's signature
// Your server receives webhooks from HookSniff
// Verify both HookSniff AND Stripe signatures
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
// 1. Verify HookSniff signature
const hooksniffSig = req.headers['webhook-signature'];
if (!verifyHookSniffSignature(req.body, hooksniffSig, 'whsec_your_secret')) {
return res.status(401).send('Invalid HookSniff signature');
}
// 2. Verify Stripe signature
const stripeSig = req.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(req.body, stripeSig, 'whsec_stripe_secret');
// 3. Process the event
switch (event.type) {
case 'payment_intent.succeeded':
handlePayment(event.data.object);
break;
}
res.status(200).json({ received: true });
});GitHub Webhooks
Route GitHub webhook events through HookSniff for reliable delivery:
- 1. Create a HookSniff endpoint for your GitHub webhook receiver
- 2. In GitHub repo โ Settings โ Webhooks โ Add webhook
- 3. Set Payload URL to your HookSniff inbound proxy URL
- 4. Set Content type to
application/json - 5. Enter your secret and select events
// Verify GitHub webhook signature
function verifyGitHubSignature(payload: string, signature: string, secret: string): boolean {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
}Shopify Webhooks
Forward Shopify webhook events for order tracking, inventory management, and more:
- 1. Create a HookSniff endpoint for your Shopify webhook handler
- 2. In Shopify Admin โ Settings โ Notifications โ Webhooks
- 3. Set the URL to your HookSniff inbound proxy
- 4. Choose events (e.g.,
orders/create,inventory_levels/update) - 5. Verify the HMAC header (
X-Shopify-Hmac-SHA256)
Generic Webhook Receiver
Build a universal webhook receiver that works with any provider:
import express from 'express';
import { HookSniff } from 'hooksniff-sdk';
import type { Metadata } from 'next';
// Revalidate every hour for ISR
export const revalidate = 3600;
export const metadata: Metadata = {
title: 'Integrations',
description: 'Connect HookSniff with your favorite tools and services',
};
const app = express();
const hr = new HookSniff({ apiKey: process.env.HOOKSNIFF_API_KEY! });
app.post('/webhooks/:provider', express.raw({ type: 'application/json' }), async (req, res) => {
const provider = req.params.provider;
const payload = JSON.parse(req.body);
// Normalize the event based on provider
const normalized = normalizeEvent(provider, payload);
// Forward through HookSniff
const delivery = await hr.webhooks.send({
endpointId: 'ep_abc123',
event: normalized.type,
data: normalized.data,
});
res.status(200).json({ deliveryId: delivery.id });
});
function normalizeEvent(provider: string, payload: any) {
switch (provider) {
case 'stripe':
return { type: payload.type, data: payload.data.object };
case 'github':
return { type: payload.event, data: payload.body };
case 'shopify':
return { type: payload.topic, data: payload };
default:
return { type: 'unknown.event', data: payload };
}
}Inbound Proxy
Use HookSniff's inbound proxy to receive webhooks from third-party services. The proxy:
- Accepts incoming webhooks on your behalf
- Validates payloads and logs delivery attempts
- Forwards to your actual endpoint with HookSniff's signature
- Provides retry logic and monitoring for inbound webhooks