@cityssm/avanti-api
Version:
An unofficial wrapper around the Avanti API.
52 lines (38 loc) • 1.67 kB
Markdown
[](https://www.npmjs.com/package/@cityssm/avanti-api)
[](https://app.deepsource.com/gh/cityssm/node-avanti-api/)
An unofficial wrapper around the [Avanti API](https://help.avanti.ca/apidocs).
**Note:**
At this time, this project focuses only on read-only endpoints, primarily on the
[`api/v1/Reporter` endpoint](https://help.avanti.ca/apidocs/get-report-data),
and employee data related endpoints.
```sh
npm install @cityssm/avanti-api
```
⭐ See the Avanti API documentation on
[](https://help.avanti.ca/apidocs/authentication-and-authorization)
for instructions on creating the needed credentials.
Note that each endpoint needs to be properly initialized in Avanti as well.
⭐ If your company is not yet on the
[](https://help.avanti.ca/support/solutions/articles/36000498186-faq#FAQ-Q:HowdoIknowifmycompanyalreadyhasthelatestASSP?),
be sure to set `latestASSP` to `false`.
The current default is `true`.
```javascript
import { AvantiApi } from '@cityssm/avanti-api'
// Initialize the API
const avanti = new AvantiApi({
tenant: 'avtesting',
// latestASSP: false,
client_id: '',
client_secret: '',
username: '',
password: '',
company: ''
})
// Export report data
const report = await avanti.getReport('CUSTOM_REPORT_ID')
// Output the data
console.log(report)
```