A Node.js wrapper for The Orange Alliance API
Note: Only supports the GET API currently.
$ npm install @the-orange-alliance/api
Using the API is simple. Just create an instance of the API class, passing in your auth key and the name of your app.
From there, call any of the methods to retrieve the data from the API.
All the requests will return a Promise of the model.
import { API } from "@the-orange-alliance/api";
// OR const { API } = require("@the-orange-alliance/api")
const toa = new API("YOUR_AUTH_KEY_HERE", "Name your app");
const event = await toa.getEvent("1920-FIM-KFQ");
console.log(event.eventName);
// OR
toa.getEvent("1920-FIM-KFQ").then(event => {
console.log(event.eventName);
});
Generate your API Key on your myTOA Account Dashboard.
Use that key in the initialization for your API object.