@matech/thebigpos-sdk
v2.41.0-rc1
Published
The Big POS Typescript SDK
Readme
The BIG POS Typescript SDK
Installation
Using npm:
$ npm install @matech/thebigpos-sdkUsing yarn:
$ yarn add @matech/thebigpos-sdkQuick Start
import { Api } from "@matech/thebigpos-sdk";
const securityWorker = (data: any) => {
return { headers: data }
}
const setBearerSecurityWorker = (accessToken:string) => {
const data = {
Authorization: `Bearer ${accessToken}`
};
apiClient.setSecurityData(data);
};
const apiClient = new Api({
baseURL:
process.env.REACT_APP_POS_API_HOST || 'https://api.thebigpos.com',
securityWorker,
})
apiClient.api.getSiteConfiguration().then((response) => {
console.log(response.data);
});Generate SDK from Swagger
To regenerate the SDK from a specific API version, run:
npx swagger-typescript-api generate -p https://api.thebigpos.dev/swagger/{version}/swagger.json -o ./src -n index.ts -r true --axios --enum-names-as-values --generate-union-enumsReplace {version} with the target API version (e.g. v2.34.0):
npx swagger-typescript-api generate -p https://api.thebigpos.dev/swagger/v2.34.0/swagger.json -o ./src -n index.ts -r true --axios --enum-names-as-values --generate-union-enumsPublishing
- Update the
versionfield inpackage.jsonbefore publishing. - Build the project:
yarn build- Publish to npm:
yarn publish© 2024 Mortgage Automation Technologies. All rights reserved
