Skip to main content
Webhook signature verification is essential for security. It ensures that webhook requests are actually from Pooler and haven’t been tampered with. This guide explains how to verify webhook signatures.

Why Verify Signatures?

Security Benefits

  • Authentication - Verify requests are from Pooler
  • Integrity - Ensure payload hasn’t been modified
  • Prevent Spoofing - Prevent attackers from sending fake webhooks
  • Compliance - Meet security and compliance requirements
Never process webhooks without verifying signatures. Unverified webhooks are a security risk.

Signature Generation

Pooler generates signatures using HMAC-SHA256 with your API key:
  1. Create Payload String - Stringify the webhook JSON payload
  2. Generate HMAC - Create HMAC-SHA256 using your API key
  3. Encode Signature - Hex encode the HMAC
  4. Include in Header - Send signature in x-swim-token header

Signature Format

Signatures are sent in the x-swim-token header as a hex-encoded HMAC-SHA256:
The signature is a simple hex string - no timestamp or version prefix.

Getting Your API Key

  1. Log in to your Pooler Dashboard
  2. Navigate to Settings → Developers
  3. Copy your API Key (use the same key you use for API requests)
Keep your API key secure. Never commit it to version control or expose it in client-side code.

Store API Key Securely

Store the API key as an environment variable:

Implementation

Node.js Implementation

Python Implementation

Go Implementation

PHP Implementation

Ruby Implementation

Testing Signature Verification

Test with Sample Webhook

Issue: JSON Stringification Differences

Different JSON stringification methods can produce different strings:

Security Best Practices

  • Never skip signature verification, even in development.
  • Use timing-safe comparison functions to prevent timing attacks.
  • Use environment variables or secret management services. Never hardcode API keys.
  • Log failed verifications for security monitoring.
  • Always use timing-safe comparison functions (e.g., crypto.timingSafeEqual, hmac.compare_digest, hash_equals) to prevent timing attacks.