@cityssm/avanti-api
Version:
An unofficial wrapper around the Avanti API.
52 lines (38 loc) • 1.78 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://avanti.stoplight.io/docs/avanti-api).
**Note:**
At this time, this project focuses only on read-only endpoints, primarily on the
[`api/v1/Reporter` endpoint](https://avanti.stoplight.io/docs/avanti-api/ed0485a9c98bb-get-report-data),
and employee data related endpoints.
```sh
npm install @cityssm/avanti-api
```
⭐ See the Avanti API documentation on
[](https://avanti.stoplight.io/docs/avanti-api/014f7884ba799-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 on the
[](https://help.avanti.ca/support/solutions/articles/36000498186-faq#FAQ-Q:HowdoIknowifmycompanyalreadyhasthelatestASSP?),
be sure to set `latestASSP` to `true`.
The current default is `false`, which will likely change in the `v1.0.0` release.
```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)
```