CLIKontract

Kontract

Generators

One schema source, many targets. Each target in sumr.yaml names one generator through generator.type; that value decides what the target emits and which options it accepts. Open a generator for its options, a worked example, and its prerequisites.

Server

Emits the application-facing boundary: controllers, DTOs, typed errors, and the validation and response foundation they depend on.

Client SDK

Emits a typed client for the same operations. All three share one option surface and differ only in how the request is sent.

Client state

Emits React data-fetching bindings on top of the same generated operations.

Models

Emits types and schemas with no transport layer. Use when another package owns the client or server.

Messaging

Emits broker-facing contracts from async schema sources.

Choosing a client

Pick by runtime, not by preference.

typescript-fetch and typescript-axios accept the same options and produce the same call surface; choose typescript-axios only when the consuming app already standardises on Axios interceptors, and typescript-fetch otherwise, since it adds no runtime dependency. Choose typescript-angular when the consumer needs the client through Angular dependency injection. Add react-query-hooks alongside a client when React components should own caching and revalidation rather than calling the SDK directly.

On this page