@effect/schema
Type-safe schema definition and runtime validation library for the Effect ecosystem, with decode, encode, and AST APIs.
Official Documentation ↗v0.70. Check the official docs for the latest API surface.Installation
npm install @effect/schemaMethods
No methods match this filter.
@effect/schema is type-safe schema definition and runtime validation library for the effect ecosystem, with decode, encode, and ast apis. This page documents the core methods, installation, and common usage patterns for the current stable release.
Installation
Install @effect/schema with your preferred package manager using the command shown in the frontmatter. The package is published to the npm registry and ships with TypeScript types where applicable.
Core methods
The methods listed in the frontmatter cover the primary API surface. Each signature reflects the v0.70 release. Consult the official documentation linked in sourceUrl for advanced options, edge cases, and breaking changes between major versions.
Frequently asked questions
The faq section in the frontmatter answers the most common questions about @effect/schema, including comparisons with alternatives, configuration tips, and runtime requirements. If your question is not covered, check the source URL for the full guide.
Errors
The following points are quoted verbatim from the official documentation. 来源:https://effect.website/docs/schema/introduction · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:49:22.908Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- However, during decoding, you’ll encounter an error, indicating that undefined is not allowed. (https://effect.website/docs/schema/introduction)
FAQ
- How is it different from Zod?
- Effect Schema integrates with the Effect runtime, supports AST transformations, and provides both decode and encode.
- Does it support JSON Schema?
- Yes. Use @effect/schema-json-schema to export a JSON Schema from an Effect schema.
- Can I use it without Effect?
- Yes. Schema validation works standalone; the Effect integration is optional.
Report a problem with this API docOpens a pre-filled issue on GitHub.