@aventara/client is a development-time generator. It reads your deployed server's client contract and writes a standalone, typed TypeScript client into your project. The generated code imports nothing from @aventara/client or @aventara/core at runtime, so @aventara/client stays a dev dependency.
import avClient from "./api/AvClient";
const users = await avClient.User.find.many({ where: { email: { contains: "example.com" } } });Calls resolve to the data (a record, a list, a count; a first-style miss is null) and everything else throws a typed error. Only what your server advertises exists on the client, in the type and at runtime, and a where offers each field only the operators it allows. When the contract carries field validators, the client checks them before it sends a call, and throws the same AvValidationError the server would answer.
In this section
| Page | Read it for |
|---|---|
| Client setup | avclient init, framework.client.ts, how to import the client, Vite, Next.js, Node and CORS |
| Typed calls | avClient.User.find.many, named types, readonly results, typing helpers |
| Client errors | The error classes and how to handle them |
| Client options | new AvClient({ entrypoint, fetch }), AvCallOptions, authentication, aborting |
| Keeping in sync | Regenerating, "up to date", CI checks, what a stale client does |
For the query language itself see Querying; for atomic multi-step writes see Transactions.
See also
- Getting started
- CLI reference
- HTTP protocol, for calling the API without the generated client
- Guides: Authentication and guards, Request IDs and diagnostics, Upgrading