@insurance-broker/api-client
v1.9.0
Published
Generated TypeScript client for the Insurance Broker Platform API. Do not edit by hand: regenerate with scripts/update-api-contract.
Readme
@insurance-broker/api-client
TypeScript types for the Insurance Broker Platform API, generated from that platform's OpenAPI document. It is published for the platform's own web and mobile applications; it is not a general-purpose library, and it carries no runtime code beyond one constant.
pnpm add @insurance-broker/api-client openapi-fetchimport createClient from 'openapi-fetch';
import type { paths } from '@insurance-broker/api-client';
const api = createClient<paths>({ baseUrl: process.env.API_BASE_URL });openapi-fetch is a peer dependency: the transport is the consumer's choice of version, and this
package only describes the shapes it carries.
What is in it
paths,components,operations,webhooks— the generated contract types.apiVersion— the API version the package was generated from, for asserting against during a compatibility window.
Nothing here is written by hand except the entry point. The types come from the backend's committed
docs/api/openapi.json, and the backend's own CI fails if the two drift apart.
Versioning
Semantic versioning against the contract, not against this file:
- major — a breaking contract change (a route or field removed, renamed, or narrowed).
- minor — an additive contract change (a new route, an optional field).
- patch — packaging only; the contract is unchanged.
Pin with a caret. A breaking change gets a compatibility window, because older mobile builds stay installed on customers' phones after a backend release.
Licence and source
Published publicly so that installing it needs no registry credentials. That is a distribution
decision, not a licence grant: this package is UNLICENSED and its source repository is private.
The API shape being readable is not a weakening of anything — backend validation and authorization
are authoritative regardless of what a client believes.
