UNPKG

tuix-marketplace-api

Version:

This package facilitates the client request to tuix marketplace api

49 lines (39 loc) 1.12 kB
# Tuix marketplace api ## Description Api Client for tuix marketplace api project ## Installation ``` npm i tuix-marketplace-api ``` If you need to use the stagging api client, then use the command ``` npm i tuix-marketplace-api@staging ``` Check the available versions in the following link: https://www.npmjs.com/package/tuix-marketplace-api?activeTab=versions ## Developing the app Tested on ``` node 18 npm 9.6.7 ``` Make an example request : ```javascript import { Configuration, ResponseError, TuixmarketplaceClientApi } from 'tuix-marketplace-api'; const configuration = new Configuration({ basePath: "https://staging-api-marketplace.tuix.ch", apiKey: "Bearer <JWT>" }); const timesheetAPIClient = new TuixmarketplaceClientApi(configuration); (async () => { try { const companies = await timesheetAPIClient.companiesGet() console.log({ companies }); } catch (error) { if(error instanceof ResponseError){ console.log(error.response.status, error.response.statusText); const data = await error.response.json() console.log(data); } } })() ```