Package Exports
- @ts-rest/core
- @ts-rest/core/index.cjs
- @ts-rest/core/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ts-rest/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ts-rest
RPC-like client and server helpers for a magical end to end typed experience
Introduction
ts-rest provides an RPC-like client side interface over your existing REST APIs, as well as allowing you define a separate contract implementation rather than going for a 'implementation is the contract' approach, which is best suited for smaller or simpler APIs.
If you have non typescript consumers, a public API, or maybe want to add type safety to your existing REST API? ts-rest is what you're looking for!
Features
- End to end type safety ๐
- Magic RPC-like API ๐ช
- Tiny bundle size ๐ (1kb!)
- Well-tested and production ready โ
- No Code Generation ๐โโ๏ธ
- Zod support for body parsing ๐ฎโโ๏ธ
- Full optional OpenAPI integration ๐
Quickstart
Install the core package
yarn add @ts-rest/core
# Optional react-query integration
yarn add @ts-rest/react-query
# Pick your backend
yarn add @ts-rest/nest @ts-rest/express
# For automatic server OpenAPI gen
yarn add @ts-rest/open-api
Create a contract, implement it on your server then consume it in your client. Incrementally adopt, trial it with your team, then get shipping faster.
๐ Read more on the official Quickstart Guide๐
Star History
Contributors โจ
Thanks goes to these wonderful people (emoji key):
Youssef Gaber ๐ป ๐ค โ ๏ธ |
Per Hermansson ๐ ๐ป |
Grรฉgory Houllier ๐ |
Michael Angelo ๐ |
Pieter Venter ๐ |
This project follows the all-contributors specification. Contributions of any kind welcome!