This project is a lightweight validation library for JavaScript and TypeScript that helps you define data “shapes” and validate runtime values against them. Instead of relying only on compile-time typing, it focuses on the reality that many apps receive unknown input from APIs, forms, and external systems, and those values need runtime checks. Its API is intentionally familiar if you’ve used TypeScript, Flow, Go structs, or GraphQL schemas, but the output is oriented around runtime correctness. When validation fails, it can throw or return detailed errors that are useful both for debugging and for communicating issues back to end users or API clients. The library is designed to be composable, so you can build larger validators from small pieces rather than rewriting similar checks in multiple places. It’s especially effective in REST or GraphQL servers, but it’s equally useful for protecting internal boundaries where untrusted or loosely typed data can slip in.

Features

  • Runtime data validation for JavaScript and TypeScript values
  • Composable “struct” definitions for building complex schemas from primitives
  • Detailed, developer-friendly validation errors for failed checks
  • Familiar type-annotation style inspired by common schema and type systems
  • Works well for validating external API inputs and internal data boundaries
  • Flexible usage patterns that support throwing errors or returning results

Project Samples

Project Activity

See All Activity >

Categories

Data Management

License

MIT License

Follow Superstruct

Superstruct Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Superstruct!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Data Management System

Registered

2 days ago