@ts-rest/vue-query
| Install | |
|---|---|
npm install @ts-rest/vue-query |
|
| Latest Version: | 3.52.1 |
| Older releases: | 3 |
| License: | MIT |
| Last Updated: | Feb 6, 2026 |
| Links: | GitHub · npm |
ts-rest
Incrementally adoptable RPC-like client and server helpers for a magical end to end typed experience 🪄
Introduction
ts-rest offers a simple way to define a contract for your API, which can be both consumed and implemented by your application, giving you end to end type safety without the hassle or code generation.
Features
- End-to-end type safety 🛟
- RPC-like client side API ⚡️
- Small Bundle Size 📉
- No Code Generation 🏃♀️
- Zod support for runtime validation 🔒
- Full optional OpenAPI integration 📝
👉 Start reading the official Quickstart Guide 👈
Super Simple Example
Easily define your API contract somewhere shared
const contract = c.router({
getPosts: {
method: 'GET',
path: '/posts',
query: z.object({
skip: z.number(),
take: z.number(),
}), // <-- Zod schema
responses: {
200: c.type<Post[]>(), // <-- OR normal TS types
},
headers: z.object({
'x-pagination-page': z.coerce.number().optional(),
}),
},
});
Fulfill the contract on your server, with a type-safe router:
const router = s.router(contract, {
getPosts: async ({ params: { id } }) => {
return {
status: 200,
body: prisma.post.findUnique({ where: { id } }),
};
},
});
Consume the api on the client with a RPC-like interface:
const result = await client.getPosts({
headers: { 'x-pagination-page': 1 },
query: { skip: 0, take: 10 },
// ^-- Fully typed!
});
Quickstart
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.
👉 Start reading the official Quickstart Guide 👈
Contributors ✨
MASSIVE Thanks to all of these wonderful people (emoji key), who have helped make ts-rest possible:
Star History
Since our first commit in 2022 we've been growing steadily. We're proud of our progress and we're excited about the future.
Related Packages
The VuePress API Playground is a Vue.js component for showcasing and testing API...
A powerful and flexible API client for Vue 3 applications, built with TypeScript...
Version History
| Version | Released | License |
|---|---|---|
| 3.52.1 | MIT | |
| 3.52.0 | MIT | |
| 3.51.1 | MIT | |
| 3.51.0 | MIT | |
| 3.50.0 | MIT | |
| 3.49.4 | MIT | |
| 3.49.3 | MIT | |
| 3.49.2 | MIT | |
| 3.49.1 | MIT | |
| 3.49.0 | MIT | |
| 3.48.1 | MIT | |
| 3.48.0 | MIT | |
| 3.47.0 | MIT | |
| 3.46.0 | MIT | |
| 3.45.2 | MIT | |
| 3.45.1 | MIT | |
| 3.45.0 | MIT | |
| 3.44.1 | MIT | |
| 3.44.0 | MIT | |
| 3.43.0 | MIT | |
| 3.42.0 | MIT | |
| 3.41.2 | MIT | |
| 3.41.1 | MIT | |
| 3.41.0 | MIT | |
| 3.40.1 | MIT | |
| 3.40.0 | MIT | |
| 3.39.2 | MIT | |
| 3.39.1 | MIT | |
| 3.39.0 | MIT | |
| 3.38.0 | MIT |
Showing the latest 30 of 45. See every release on npm
Pre-releases (15)
| Version | Released | License |
|---|---|---|
| 3.53.0-rc.1 | MIT | |
| 3.53.0-rc.0 | MIT | |
| 3.53.0-alpha.3 | MIT | |
| 3.53.0-alpha.2 | MIT | |
| 3.53.0-alpha.1 | MIT | |
| 3.53.0-alpha.0 | MIT | |
| 3.52.0-alpha.1 | MIT | |
| 3.52.0-alpha.0 | MIT | |
| 3.49.0-beta.4 | MIT | |
| 3.49.0-beta.3 | MIT | |
| 3.49.0-beta.2 | MIT | |
| 3.49.0-beta.1 | MIT | |
| 3.45.0-beta.1 | MIT | |
| 3.45.0-beta.0 | MIT | |
| 3.36.0-beta.0 | MIT |