Typescript Fetch Client SDK for trivium
Using typescript-axios generator from OpenAPI Generator.
To generate client from OpenAPI spec (docs.yaml):
-
Install OpenAPI Generator
-
Generate client files:
openapi-generator generate -i docs.yaml -g typescript-axios -o src
-
Build project:
npm install
npm run clean
npm run build
To use SDK:
import { UserApi, Configuration } from 'trivium-ts-sdk';
const client = new UserApi(
new Configuration({
apiKey: '<your-api-key>',
accessToken: '<your-api-secret>'
}),
'https://staging.api.triviumcapital.tech'
);
const user = await client.postApiV1User();