Skip to content

basalt / sdk/src / createClient

Function: createClient() ​

> createClient<T>(endpoints, options): Client<T>

Defined in: sdk/src/client.ts:76

Builds a typed client from an endpoint tree:

const api = createClient(endpoints, { baseUrl, getToken, refresh }) const project = await api.projects.create({ body: { name: 'Basalt' } })

Type Parameters ​

T ​

T extends EndpointTree

Parameters ​

endpoints ​

T

options ​

ClientOptions

Returns ​

Client<T>

Released under the MIT License.