@sutro-dev/sutro-client-sdk
v1.0.1
Published
The Sutro Client SDK provides a framework for us to generate a client-side SDK for interacting with a Sutro generated backend.
Keywords
Readme
Sutro Client SDK
The Sutro Client SDK provides a framework for us to generate a client-side SDK for interacting with a Sutro generated backend.
An SDK can be built thusly:
import { SdkBuilder } from '@sutro-dev/sutro-client-sdk';
const sdk = new SdkBuilder()
.withOpenApi(openApiDocument)
.withBaseUrl(baseUrlOfSutroBackend)
.withFetchImpl(fetch)
.withAuthProvider(authenticationProvider)
.declareInterface<InterfaceProvidedBySutro>()
.build();What Sutro provides
For a generated app, Sutro will provide
- an OpenApi document describing the server API
- a TypeScript file with API types, including an interface for the SDK
- the base URL of the api server
API Docs
Run turbo build:docs to generate API documentation if it doesn't currently exist
