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.

  1. Go to your GitFables dashboard
  2. Navigate to Settings > Webhooks
  3. Click "Add Webhook"
  4. Enter your endpoint URL and select events
  5. Save your webhook configuration
3

Event Types

Available webhook events you can subscribe to.

story.generated

When a new story is generated

story.updated

When a story is updated

template.created

When a new template is created

template.updated

When 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