@bueno-analytics/node-sdk
v1.4.2
Published
A Node.js package for interacting with the Bueno HTTP API.
Downloads
455
Readme
node-sdk
A Node.js package for interacting with the Bueno HTTP API.
🌏 Bueno Website | ⚙️ API Documentation (HTTP) | 📗 Changelog | 💳 License
Prerequisites
- Node.js >=20.19.x <25
Install
yarn add @bueno-analytics/node-sdk
npm install @bueno-analytics/node-sdkUsage
// Import the API client
import { BuenoAPI } from '@bueno-analytics/node-sdk'
// Create a new instance of the client
const client = new BuenoAPI({
apiUrl: 'https://au.api.bueno-analytics.com'
})
// Request data!
const sites = await client.getSitesByOrganisationId('00000000-0000-0000-0000-000000000000')
console.log(sites)Exports
There are several exports this package provides which may come in handy when working with our data model.
// root, the main API client
import { BuenoAPI } from '@bueno-analytics/node-sdk'
// lib, useful library functions
import { /* */ } from '@bueno-analytics/node-sdk/lib'
// types, publicly available types for our data model
import { /* */ } from '@bueno-analytics/node-sdk/types'Logging
Internally we use Winston for logging. Output can be configured using the LOG_LEVEL environment variable using the log level values here. The default is debug.
LOG_LEVEL=warn node my-script.jsDocumentation & TypeScript
@bueno-analytics/node-sdk ships with TypeScript types built-in to every available method, links to the relevant API documentation, and descriptions of each method via JSDoc.
