Webhooks
Receive real-time data from external services via webhooks.
8 min readUpdated December 2024
What are Webhooks?
Webhooks allow external services to send data to Solinth automatically when events occur. Instead of polling for updates, you receive data in real-time.
How It Works
- Create a webhook endpoint in Solinth
- Copy the unique webhook URL
- Configure the external service to send data to this URL
- Solinth receives and processes the data automatically
Creating a Webhook Endpoint
Step 1: Navigate to Webhooks
Go to Settings → Webhooks and click Create Webhook.
Step 2: Configure the Endpoint
- Name: A descriptive name (e.g., "Stripe Payments")
- Event Type: What type of events to expect
- Mapping: How to map incoming data to Solinth events
Step 3: Copy the Webhook URL
After creating the webhook, you'll receive a unique URL like:
https://api.solinth.com/webhooks/wh_abc123xyzKeep Your Webhook URL Secret
Treat your webhook URL like a password. Anyone with the URL can send data to your Solinth account.
Verifying Webhook Signatures
For security, verify that webhook requests are authentic by checking the signature.
Verify Signature (Node.js)
import crypto from 'crypto';
function verifyWebhookSignature(payload, signature, secret) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from('sha256=' + expectedSignature)
);
}
// In your webhook handler
app.post('/webhook', (req, res) => {
const signature = req.headers['x-solinth-signature'];
const isValid = verifyWebhookSignature(
JSON.stringify(req.body),
signature,
process.env.WEBHOOK_SECRET
);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
// Process the webhook...
res.status(200).send('OK');
});Supported Services
Solinth has pre-built webhook handlers for popular services:
- Stripe: Payments, subscriptions, invoices
- GitHub: Commits, pull requests, issues
- Shopify: Orders, products, customers
- Twilio: SMS, calls, messages
- Custom: Any JSON webhook payload
Retry Logic
If your webhook endpoint fails to respond with a 2xx status code, Solinth will retry the delivery:
- 1st retry: After 1 minute
- 2nd retry: After 5 minutes
- 3rd retry: After 30 minutes
- 4th retry: After 2 hours
- 5th retry: After 24 hours
Webhook Logs
View all webhook deliveries and their status in Settings → Webhooks → Logs.