@bimdata/typescript-fetch-api-client

OpenAPI client for @bimdata/typescript-fetch-api-client

Usage no npm install needed!

<script type="module">
  import bimdataTypescriptFetchApiClient from 'https://cdn.skypack.dev/@bimdata/typescript-fetch-api-client';
</script>

README

@bimdata/typescript-fetch-api-client

This package provide a javascript client to interact with BIMData API as well as all necessary typings for usage in typescript projects and autocompletion in VSCode.

This package is generated using OpenAPI Generator.

Installation

To install this package simply run: npm install @bimdata/typescript-fetch-api-client

Usage

Note: This section is about using the typescript-fetch API client in your project, if you want to know more about BIMData API and what's possible to do with it, please refer to the documentation.

Initialize and use an API client

In order to perform calls to the API you'll need to create an API client with a configuration object. The snippet below shows an example of how to do it.

import { makeBIMDataApiClient } from '@bimdata/typescript-fetch-api-client';

const apiClient = makeBIMDataApiClient({ apiUrl, accessToken });

apiClient.collaborationApi.getClouds().then(
  clouds => console.log('Here is the list of clouds: ', clouds)
);

Once the client is created you can update its access token this way:

apiClient.accessToken = newAccessToken