@invect/webhooks
v0.0.12
Published
Webhook trigger plugin for Invect — adds webhook management, ingestion, signature verification, and a dedicated webhooks UI page
Maintainers
Readme
Adds webhook management, ingestion, signature verification, and rate limiting to Invect. Create webhook endpoints that trigger flow runs when external services send events.
Install
pnpm add @invect/webhooksBackend
import { webhooks } from '@invect/webhooks';
const invectRouter = await createInvectRouter({
database: { type: 'sqlite', connectionString: 'file:./dev.db' },
encryptionKey: process.env.INVECT_ENCRYPTION_KEY,
plugins: [webhooks()],
});
app.use('/invect', invectRouter);Options
webhooks({
webhookBaseUrl: 'https://example.com/api/invect', // Base URL for webhook endpoints
rateLimitMaxRequests: 60, // Max requests per window (default: 60)
rateLimitWindowMs: 60_000, // Rate limit window in ms (default: 60s)
dedupTtlMs: 86_400_000, // Deduplication TTL in ms (default: 24h)
});Frontend
import { Invect } from '@invect/ui';
import { webhooksFrontend } from '@invect/webhooks/ui';
<Invect apiBaseUrl="/api/invect" plugins={[webhooksFrontend]} />;The plugin adds a Webhooks page to the sidebar for managing webhook triggers.
Features
- Signature verification — HMAC validation for GitHub, GitLab, Slack, and generic providers.
- Rate limiting — Per-IP/path rate limiting with configurable windows.
- Deduplication — Idempotency via event deduplication (24h TTL default).
- IP allowlisting — Restrict webhook sources by IP address.
Exports
| Entry Point | Content |
| ------------------------ | ---------------------------------------------------- |
| @invect/webhooks | Backend plugin (Node.js) |
| @invect/webhooks/ui | Frontend plugin — webhooksFrontend, WebhooksPage |
| @invect/webhooks/types | Shared types |
