Type-safe APIs, shared packages, auth & docs out of the box. Built for developer experience.
Create a NestJS endpoint and call it from the frontend with complete type safety.
@Router( alias: 'users'})
export class UserRouter {
@Query({
output: z.array(usersSchema),
})
readAll() {
return this.usersService.findAll();
}
}'use client';
import { trpc } from '@web/libs/trpc-client';
export default function MyPage() {
// ✨ Autocomplétion complète
const { data, isLoading } = trpc.users.readAll.useQuery();
return (
<div>
{isLoading ? 'Loading...' : JSON.stringify(data)}
</div>
);
}Click the button to fetch data