Skip to main content

Webhooks Guide

Learn how to receive and process Fanfare webhooks for real-time event notifications.

Overview

Fanfare webhooks notify your server when events occur in your experiences. Use webhooks to synchronize data, trigger workflows, and respond to consumer actions in real-time. What you’ll learn:
  • Setting up webhook endpoints
  • Verifying webhook signatures
  • Handling different event types
  • Implementing retry logic
  • Best practices for reliability
Complexity: Advanced Time to complete: 35 minutes

Prerequisites

  • Fanfare account with API access
  • Server capable of receiving HTTP POST requests
  • Understanding of webhook patterns
  • HTTPS endpoint (required for production)

Webhook Architecture

Webhook delivery flow showing Fanfare event delivery, webhook endpoint processing, success, and retry.

Step 1: Configure Webhooks

Admin Dashboard Setup

  1. Navigate to Settings > Webhooks in the Fanfare admin
  2. Click Add Endpoint
  3. Enter your endpoint URL (must be HTTPS)
  4. Select events to subscribe to
  5. Copy the signing secret

API Configuration

Step 2: Create Webhook Handler

Express.js Handler

Next.js API Route Handler

Step 3: Process Webhook Events

Event Processor

Event Handlers

Draw Event Handlers

Step 4: Handle Failures and Retries

Retry Logic

Fanfare automatically retries failed webhooks with exponential backoff:

Handling Retries in Your Code

Dead Letter Queue

Step 5: Testing Webhooks

Local Development with Tunnels

Test Webhook Delivery

Unit Testing Handlers

Event Reference

Queue Events

Draw Events

Auction Events

Experience Events

Best Practices

1. Acknowledge Quickly

2. Handle Out-of-Order Events

3. Monitor Webhook Health

Troubleshooting

Signature Verification Failing

  1. Ensure you’re using the raw request body
  2. Check webhook secret is correct
  3. Verify timestamp is within acceptable range

Events Not Being Received

  1. Check endpoint URL is publicly accessible
  2. Verify HTTPS certificate is valid
  3. Review Fanfare webhook delivery logs
  4. Check firewall rules

Duplicate Events

  1. Implement idempotency checks
  2. Use event IDs for deduplication
  3. Check for distributed lock issues

What’s Next