Skip to content

BitGo/api-ts

Repository files navigation

api-ts

Build Status

A collection of packages for defining and using type-checked APIs with TypeScript.

TypeScript is a powerful type system layered on top of JavaScript, but lacks type information about values received at runtime. This is an explicit non-goal of the TypeScript language, so we use io-ts to statically type this runtime data. io-ts-http builds on top of io-ts to define codecs that translate between HTTP requests and plain old JavaScript objects. Additionally, it provides a way to group these codecs into route definitions, and then collect the route definitions into an API. The resulting API definitions may then be used on the client and server to have type-checked and runtime-validated HTTP calls in a standardized manner.

io-ts Compatibility

api-ts is built and tested against the stable channel of io-ts (v2.1). api-ts is not currently compatible with the experimental channel of io-ts (v2.2).

Developing

npm install
npm run build
npm test

License

This work is published under the Apache 2.0 license.

SPDX-License-Identifier: Apache-2.0