Webhooks

Wire

Wire your app to a service. Programmatically registers webhook subscriptions via the source service's API (Stripe, Linear, Pollinate). Backend tracks state in your DB and always points subscriptions at the catch-all route `/api/khotan/webhook/:plugName`, where Catch and Pass handlers fan out internally.

api + ui
Active
Setup
register
service api

Install

$ npx khotan add wire <source>

Modes

Backend only
Set and forget. Call the same API routes the UI uses, or use the CLI to connect and disconnect wires from your terminal.
# CLI — connect a wire using KHOTAN_WEBHOOK_URL
npx khotan wire pollinate connect
# CLI — inspect current wire state
npx khotan wire pollinate --info
# CLI — disconnect the current wire
npx khotan wire pollinate disconnect
// Under the hood this registers Pollinate against:
// https://<public-url>/api/khotan/webhook/pollinate
//
// The catch-all route verifies the signature, then fans out
// to any registered catches and passes for that plug.
With UI (--with-ui)
A React panel that shows current status, callback URL, subscribed events, and connect/disconnect actions. Same backend routes as the CLI.
import { WirePanel } from '@/components/khotan/wire-panel'
// Reads /api/khotan/wires/pollinate
// Creates via POST /api/khotan/wires/pollinate
// Disconnects via DELETE /api/khotan/wires/pollinate
<WirePanel
plugName="pollinate"
webhookUrl={process.env.NEXT_PUBLIC_WEBHOOK_URL}
/>
// Default callback shape:
// <origin>/api/khotan/webhook/pollinate

Documentation

See the full integration guide — schema, generated files, helper API, and configuration — in the Wire docs.