Typed client creation
View as MarkdownIdentity
Section titled “Identity”createApiClient and ApiError from @sapporta/shared/client; getApiBase from @sapporta/frontend/platform.
Contract
Section titled “Contract”- The contract route ID becomes the client method name.
- Calls pass
params,query, andbodyaccording to the route contract. baseUrlaccepts the deferredgetApiBaseresolver used by generated frontends.- 2xx responses return the parsed body; non-2xx responses throw
ApiErrorwith status and parsed body. - Browser credentials follow the generated same-origin/split-origin client configuration.