- Notifications
You must be signed in to change notification settings - Fork2
License
kylestev/ge-tracker-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Unofficial API client to accessge-tracker.com's API.
Using NPM:
$ npm i ge-tracker-api
Using Yarn:
$ yarn add ge-tracker-api
GE-Tracker requires a valid API key in order to consume their API endpoints.Thus, if you wish to use this package, you must have an API key.
There are two functions exposed by this module:
createClient(apiKey, opts = null) andcreateClientFromEnv(opts = null).
CallingcreateClient requires an API key to be passed in order to initializethe underlying Axios instance with your API key for all subsequent requests.
CallingcreateClientFromEnv will attempt to find the environment variablenamedGE_TRACKER_API_KEY and use that as the API key.
// example.jsconst{ createClientFromEnv}=require('ge-tracker-api')constclient=createClientFromEnv()client.Items.getItem(1050).then(item=>{console.log(`${item.name} has${item.buyingQuantity} buy offers and is buying for ~${item.buying}`)})
How you set the environment variable will depend on your developmentenvironment.
For bash, you can prepend the environment variable before calling a script onyour path like so:
$ GE_TRACKER_API_KEY=ajosf...928h4tr node example.js
Please note that prepending your API key before a command may record yoursensitive API token to your bash or shell history.
A better approach is to use something likedotenv. Take care to ensure that yourenvironment file used by that library is added to your.gitignore file 😉
About
Resources
License
Uh oh!
There was an error while loading.Please reload this page.