@biodatos/biodatos-microservices-client
v2.3.1
Published
The @biodatos/biodatos-microservices-client is a JavaScript library designed to interact with Biodatos microservices. It provides a comprehensive client-side interface for communicating with various microservices offered by the Biodatos platform, enabling
Downloads
39
Readme
Biodatos Microservices Client
The @biodatos/biodatos-microservices-client
is a JavaScript library designed to interact with Biodatos microservices. It provides a comprehensive client-side interface for communicating with various microservices offered by the Biodatos platform, enabling seamless data retrieval, processing, and management. This package simplifies the integration of Biodatos functionalities into any JavaScript application, ensuring scalability, efficiency, and ease of use for developers working on bioinformatics and related fields.
Table of Contents
Installation
To install the SDK, you can use npm, yarn, or pnpm:
npm
npm install @biodatos/biodatos-microservices-client
yarn
yarn add @biodatos/biodatos-microservices-client
pnpm
pnpm add @biodatos/biodatos-microservices-client
Usage
Here is a basic example of how to use the SDK:
import {
ApiService,
BiodatosMicroservicesClient,
E_BIODATOS_ENVIRONMENT,
GetHealthCheckResponse,
OpenAPI,
OpenAPIConfig,
} from '@biodatos/biodatos-microservices-client';
const getClient = async (): Promise<BiodatosMicroservicesClient> => {
const clientOptions: OpenAPIConfig = OpenAPI;
clientOptions.BASE = 'https://microservices.biodatos.co' || E_BIODATOS_ENVIRONMENT.PRODUCTION;
clientOptions.HEADERS = {
'Content-Type': 'application/json',
Authorization: `Bearer YOUR_API_KEY`,
};
return new BiodatosMicroservicesClient(clientOptions);
};
const checkHealth = async (): Promise<void> => {
const client: BiodatosMicroservicesClient = await getClient();
const apiHealthService: ApiService = client.api;
const response: GetHealthCheckResponse = await apiHealthService.getHealthCheck();
console.log(`Health check response: ${response.statusCode}`);
console.debug(response);
};
const main = async (): Promise<void> => {
await checkHealth();
};
main().catch((error) => {
console.error(error);
process.exit(1);
});
Testing
To run the tests located in the src/__test__
directory, use the following command:
npm
npm test
yarn
yarn test
pnpm
pnpm test
Examples
You can find more examples in the examples
directory. These examples demonstrate various use cases of the SDK.
License
This project is licensed under the MIT License. See the LICENSE file for more details.