Skip to main content
@mynthio/sdk/tanstack-start provides mynthWebhookHandler() for handling signed Mynth webhooks in TanStack Start server routes.
Set the signing secret shown when you create the webhook:
The helper reads the raw request body, verifies X-Mynth-Signature, checks X-Mynth-Event, and calls the matching typed handler. Each handler also receives the original unread TanStack Start request, route params, and middleware context. Keep the server route publicly reachable. Make callback side effects idempotent, and enqueue slow work before returning. Callback errors are propagated so Mynth can retry the delivery. Pass { webhookSecret: "wbs_..." } as the second argument when the application does not use MYNTH_WEBHOOK_SECRET. The helper accepts signed dashboard-managed webhooks; request-level custom webhooks are not signed.