Standard Schema
Bring Zod, Valibot, ArkType, or any Standard Schema-compatible library.
webhooks validates route payloads through Standard Schema, so it works with any compatible validation library — bring Zod, Valibot, ArkType, or any other Standard Schema implementation.
import { createWebhookRouter } from "@zap-studio/webhooks";
const router = createWebhookRouter();
import { z } from "zod";
router.register("/event", {
schema: z.object({ id: z.string() }),
handler: ({ payload }) => Response.json(payload),
});import * as v from "valibot";
router.register("/event", {
schema: v.object({ id: v.string() }),
handler: ({ payload }) => Response.json(payload),
});import { type } from "arktype";
router.register("/event", {
schema: type({ id: "string" }),
handler: ({ payload }) => Response.json(payload),
});When those libraries implement the Standard Schema spec, you keep one validation flow across your app instead of writing library-specific request handling.