---
title: Standard Schema
description: Bring Zod, Valibot, ArkType, or any Standard Schema-compatible library.
type: package
package: "@zap-studio/webhooks"
---

`webhooks` validates route payloads through [Standard Schema](https://github.com/standard-schema/standard-schema), so it works with any compatible validation library — bring Zod, Valibot, ArkType, or any other Standard Schema implementation.

```ts
import { createWebhookRouter } from "@zap-studio/webhooks";

const router = createWebhookRouter();
```

<CodeGroup>

```ts Zod
import { z } from "zod";

router.register("/event", {
  schema: z.object({ id: z.string() }),
  handler: ({ payload }) => Response.json(payload),
});
```

```ts Valibot
import * as v from "valibot";

router.register("/event", {
  schema: v.object({ id: v.string() }),
  handler: ({ payload }) => Response.json(payload),
});
```

```ts ArkType
import { type } from "arktype";

router.register("/event", {
  schema: type({ id: "string" }),
  handler: ({ payload }) => Response.json(payload),
});
```

</CodeGroup>

When those libraries implement the Standard Schema spec, you keep one validation flow across your app instead of writing library-specific request handling.

## See Also

- [Type-Safe Routing](/webhooks/type-safe-routing)
