Integration Guide

This guide will help you set up a webhook integration between Supabase and HookFlo, allowing you to receive real-time alerts when database changes, authentication events, and other activities occur in your Supabase project.

Supabase uses a combination of database triggers and Postgres functions to deliver webhook events. HookFlo seamlessly integrates with both Supabase’s built-in webhooks and custom webhook implementations.

Prerequisites

  • A HookFlo account with an active project
  • A Supabase project with admin access
  • Basic understanding of Supabase database and functions

Integration Overview

The integration process follows these key steps:

  1. Set up a webhook in HookFlo
  2. Configure notification channels (email/Slack)
  3. Connect Supabase to HookFlo
  4. Test the integration

Setting Up Your HookFlo Webhook

After logging into HookFlo, follow these steps to create and configure your Supabase webhook:

1

Create a Webhook

2

Setup Notification Channel

3

Connect your Webhook with application

Configuring Supabase

Now that your HookFlo webhook is set up, you need to configure Supabase to send events to it:

1

Setup Supabase Webhook

2

Create a Database Webhook

3

Enable HTTP Extension (If Needed)

4

Select Tables to Monitor

Testing Your Integration

To ensure your integration is working properly:

1

Generate Test Events

2

Verify in HookFlo

Advanced Configuration

Webhook Payload Structure

Here’s an example of what the webhook payload looks like for different events:

Database Event Payload

{
  "table": "users",
  "schema": "public",
  "event": "INSERT",
  "record": {
    "id": "d9be2f69-5d13-4ac3-8f77-1193e9b1bfe3",
    "email": "user@example.com",
    "created_at": "2023-04-01T12:00:00Z"
  },
  "old_record": null
}

Authentication Event Payload

{
  "event": "SIGNED_UP",
  "instance": "your-project-ref",
  "timestamp": "2023-04-01T12:00:00Z",
  "user": {
    "id": "d9be2f69-5d13-4ac3-8f77-1193e9b1bfe3",
    "email": "user@example.com"
  }
}

Troubleshooting

Example: Monitoring New User Signups

Here’s a complete example of setting up HookFlo to alert your team when new users sign up:

1

Create the Webhook in HookFlo

Follow the steps above to create a Supabase webhook in HookFlo and configure your notification channels.

2

Configure the Database Webhook in Supabase

  1. In your Supabase dashboard, go to Database > Webhooks
  2. Create a new webhook named “user-signups”
  3. Select the auth.users table (or your custom users table)
  4. Choose the INSERT event type to trigger on new user creations
  5. Add your HookFlo webhook URL and headers (x-webhook-id and x-webhook-token)
  6. Save the webhook

Security Considerations

When setting up webhook integrations between Supabase and HookFlo, keep these security best practices in mind:

  • Protect your webhook credentials: Keep your x-webhook-id and x-webhook-token secure
  • Use row-level security: Limit what data can be included in webhook payloads
  • Implement data minimization: Only send the fields you actually need
  • Regular audits: Remove webhooks from tables that no longer need monitoring
  • Use HTTPS only: Ensure all webhook communications use secure protocols

Congratulations! 🎉

You’ve successfully set up real-time event tracking and alerting between Supabase and HookFlo in just few minutes. Your team can now receive immediate notifications about important database and authentication events, helping you respond quickly to critical situations.

Need more help? Contact our support team or join our Discord forum or DM me directly on X.