Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

hookflo-tern

bởi prateek32177

Web & Frontend Development
419Lượt tải do clawskills.sh công bố
2Sao
1Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Use this skill for requests touching webhooks, event-driven infrastructure, or real-time HTTP callbacks.

Mô tả

Kỹ năng này làm gì

Tern is a zero-dependency TypeScript library for verifying webhook signatures across platforms like Stripe, GitHub, and Clerk, supporting HMAC and token-based schemes. Hookflo is a hosted service that receives webhooks, logs events, and sends Slack or email alerts with no code changes required on your end. The two tools work independently or together.

Tern abstracts per-provider HMAC quirks and raw-body requirements into a single API call, replacing manual signature verification code for each platform.

Khi nào nên dùng

  • Verifying Stripe payment webhooks before fulfilling orders
  • Getting Slack alerts when a GitHub push or pull request event fires
  • Blocking replay attacks on webhook endpoints with timestamp validation
  • Centralizing webhook event logs across multiple SaaS providers
  • Adding signature verification for a custom provider not on the default platform list

Quy trình ví dụ

ĐẦU VÀO

User asks: How do I verify Stripe webhooks in Express and get notified on Slack when a payment succeeds?

AGENT
  1. 1

    Install @hookflo/tern and add an Express route with express.raw({ type: 'application/json' }) to preserve the raw request body

  2. 2

    Call WebhookVerificationService.verifyWithPlatformConfig(req, 'stripe', process.env.STRIPE_WEBHOOK_SECRET) and return 400 if result.isValid is false

  3. 3

    Process result.payload for the verified event, checking event.type for payment_intent.succeeded

  4. 4

    Create a Hookflo webhook endpoint in the dashboard, paste the Hookflo URL into Stripe's webhook settings, and configure a Slack notification channel

ĐẦU RA

An Express endpoint that cryptographically verifies Stripe webhooks and triggers Slack alerts via Hookflo when payments succeed

Yêu cầu

  • STRIPE_WEBHOOK_SECRET environment variable (webhook signing secret from Stripe Dashboard, required for Stripe verification)
  • GITHUB_WEBHOOK_SECRET environment variable (webhook secret from GitHub repo or org settings, required for GitHub verification)
  • CLERK_WEBHOOK_SECRET environment variable (webhook signing secret from Clerk Dashboard, required for Clerk verification)
  • SUPABASE_WEBHOOK_ID environment variable (webhook ID from Supabase Dashboard, required for Supabase verification)
  • SUPABASE_WEBHOOK_TOKEN environment variable (webhook token from Supabase Dashboard, required for Supabase verification)
  • Hookflo account at hookflo.com for the hosted alerting and logging features

Cài đặt

clawhub install prateek32177/hookflo-tern

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết