Tern: A cross-platform webhook verification SDK for Next.js

Every webhook provider has a different signature algorithm, different header format, and different secret format. Stripe is not GitHub is not Clerk is not Shopify.

You end up writing the same verification boilerplate from scratch every single time.

The Solution

Tern absorbs all of it. One SDK, 16+ providers, same pattern every time:

import { createWebhookHandler } from '@hookflo/tern/nextjs'

export const POST = createWebhookHandler({
  platform: 'stripe',
  secret: process.env.STRIPE_WEBHOOK_SECRET!,
  handler: async (payload) => {
    return { received: true }
  },
})

Switch to Clerk? Change one word. Add GitHub? Change one word. Zero new boilerplate.

Reliability Layer

The part most libraries ignore

What happens after verification? Your handler throws, the provider retries, events get lost, and customers end up in broken states.

Tern has an optional reliability layer — queue, automatic retries, dead letter queue, replay, and Slack or Discord alerts. All opt-in. No lock-in.

Zero dependencies. MIT licensed. Open source.

github.com

GitHub - Hookflo/tern: Zero-dependency webhook signature verification and…

Zero-dependency webhook signature verification and reliability SDK

tern.hookflo.com

1 Like

Nice idea! Thanks for sharing the repo

2 Likes

Thanks for sharing the repo

1 Like