Webhooks
Learn how to use webhooks to receive real-time updates from GitFables.
1
Overview
Webhooks allow your application to receive automatic notifications and data updates.
Benefits of using webhooks:
- Real-time updates without polling
 - Automatic notifications for important events
 - Efficient integration with your systems
 - Reduced API calls and latency
 
2
Setting Up Webhooks
Configure webhooks through your GitFables dashboard.
- Go to your GitFables dashboard
 - Navigate to Settings > Webhooks
 - Click "Add Webhook"
 - Enter your endpoint URL and select events
 - Save your webhook configuration
 
3
Event Types
Available webhook events you can subscribe to.
story.generatedWhen a new story is generated
story.updatedWhen a story is updated
template.createdWhen a new template is created
template.updatedWhen a template is updated
4
Webhook Payload
Example webhook payload structure.
webhook-payload.json
JSON
{
  "event": "story.generated",
  "timestamp": "2024-01-01T00:00:00Z",
  "data": {
    "id": "story-id",
    "title": "Story Title",
    "content": "Story content...",
    "repository": {
      "name": "repo-name",
      "url": "https://github.com/user/repo"
    }
  }
}Example webhook payload structure
5
Security
Verify webhook signatures to ensure authenticity.
Each webhook request includes a signature in the X-GitFables-Signature header.
verify-signature.js
JavaScript
// Example signature verification in Node.js
const crypto = require('crypto');Webhook signature verification example