# Superstruct

[BASE product page](<https://base.akulich.dev/en/library/superstruct/>) · [Resource](<https://github.com/ianstormtaylor/superstruct>)

ID: superstruct · Language: en
Schema version: 1 · Data version: cbbe7123b47a5ae80983

This is editorial data. An unknown field neither confirms nor rules out a capability.
dataVersion is a dataset fingerprint, not evidence of a recent fact check.

A JavaScript and TypeScript runtime validation library: it defines data structures and validates application API boundaries\.

## Type

Backend / API library

## Entry type

library

## Separate catalog

No

## [Access conditions](<https://base.akulich.dev/en/library/superstruct/#resource-access>)

free

## [What you can use for free](<https://base.akulich.dev/en/library/superstruct/#resource-access>)

Code and local use under MIT\.

## [Paid features and costs](<https://base.akulich.dev/en/library/superstruct/#resource-access>)

Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Access and limitations](<https://base.akulich.dev/en/library/superstruct/#resource-access>)

Code and local use under MIT\. Computing resources, self\-hosting, and external services are paid for separately if used\.

## [Use cases](<https://base.akulich.dev/en/library/superstruct/#resource-tasks>)

- Validate input structure at runtime
- Add validation at an API boundary and test acceptance and rejection of examples

## Category IDs

- backend
- frontend

## Subcategory IDs

- backend\.api
- frontend\.forms

## Tags

- Superstruct
- API
- Development

## Also known as

- ianstormtaylor/superstruct
- superstruct
- data\-validation\-js
- superstruct\-validation

## [Selection purpose](<https://base.akulich.dev/en/library/superstruct/#resource-selection>)

Validate input structure at runtime

## [Choose this when](<https://base.akulich.dev/en/library/superstruct/#resource-selection>)

- Validate input structure at runtime
- Add validation at an API boundary and test acceptance and rejection of examples

## [Requirements](<https://base.akulich.dev/en/library/superstruct/#resource-selection>)

- Define structs and decide where coercion is acceptable and where input must be strictly rejected\.

## [Limitations](<https://base.akulich.dev/en/library/superstruct/#resource-selection>)

- Costs and limits of free use: Computing resources, self\-hosting, and external services are paid for separately if used\.
- Terms of use: MIT for the code; dependencies have separate licenses\.
- A TypeScript type alone does not validate external JSON\. Custom email/UUID rule correctness depends on the chosen validator\.

## [Questions before use](<https://base.akulich.dev/en/library/superstruct/#resource-faq>)

### What can you use for free in Superstruct?

Code and local use under MIT\.

### What additional costs might arise with Superstruct?

Computing resources, self\-hosting, and external services are paid for separately if used\.

### What terms of use matter for Superstruct?

MIT for the code; dependencies have separate licenses\.

### How do you get started with Superstruct?

Define a schema for external data entering the application\. Add validation at an API boundary and test acceptance and rejection of examples\. Add error handling and an integration check of the result\.

### How do assert, is, validate, and create differ in Superstruct?

A Struct defines data shape for runtime validation\. assert throws on mismatch; is and validate check without that throw\. create applies coercion/default values during validation\. Custom validators are defined separately, and TypeScript can narrow data types after successful validation\.

## Sources for the selection guide

- [https://github\.com/ianstormtaylor/superstruct](<https://github.com/ianstormtaylor/superstruct>)
- [https://raw\.githubusercontent\.com/ianstormtaylor/superstruct/HEAD/Readme\.md](<https://raw.githubusercontent.com/ianstormtaylor/superstruct/HEAD/Readme.md>)
- [https://raw\.githubusercontent\.com/ianstormtaylor/superstruct/HEAD/package\.json](<https://raw.githubusercontent.com/ianstormtaylor/superstruct/HEAD/package.json>)
- [https://www\.open\-source\-tools\.com/](<https://www.open-source-tools.com/>)

## [Possible workflow](<https://base.akulich.dev/en/library/superstruct/#resource-scenario>)

Validate input structure at runtime\.

A possible workflow; this is not a report of hands-on testing.

## Before you start

- A data contract or HTTP workflow\.
- A project with a supported runtime\.

## Steps

1. Define a schema for external data entering the application\.
2. Add validation at an API boundary and test acceptance and rejection of examples\.
3. Add error handling and an integration check of the result\.

## Check your result

- Invalid and missing data are handled predictably\.
- Types and the actual response agree; errors are not hidden\.

## [License](<https://base.akulich.dev/en/library/superstruct/#resource-license>)

MIT for the code; dependencies have separate licenses\.

## License explanations for the specified scope

### MIT — permissive license

You can use, modify, distribute, and sell the code, including in a closed\-source commercial product\. When sharing copies or substantial portions of the code, retain the license text and copyright notice\. You do not need to open\-source your entire project; the author provides no warranties\.

[License terms](<https://opensource.org/license/mit>)

## [Sources](<https://base.akulich.dev/en/library/superstruct/#resource-sources>)

- [Official source](<https://github.com/ianstormtaylor/superstruct>)
- [Official source](<https://raw.githubusercontent.com/ianstormtaylor/superstruct/HEAD/Readme.md>)
- [License](<https://raw.githubusercontent.com/ianstormtaylor/superstruct/HEAD/package.json>)
- [Catalog / discovery source](<https://www.open-source-tools.com/>)

## Editorial review date

2026\-10\-06

## Editorial review scope

The purpose, current repository license, and separate terms for code, services, and models have been reviewed\. The product was not run, and no security audit was performed\.

Dates refer to the stated editorial review, not hands-on testing, a product update, or a recent review of all sources.
