warcraftlog-api-v2
v0.2.2
Published
This package allow you to simply fetch data from the GraphQL API of WarcraftLog.
Downloads
5
Readme
Warcraft Log API V2
This package allow you to simply fetch data from the GraphQL API of WarcraftLog.
Build
Issues / Pull Requests
Installation
npm install warcraftlog-api-v2
Dependency
Usage
Initializing API
const WarcraftLog = require("./index");
WarcraftLog.connect(
WL_CLIENT_ID,
WL_CLIENT_SECRET
)
Fetch data
These line come from my test.js All data fetched are formatted in JSON.
WarcraftLog.getCharacterByName("charactername", "serverslug", "region").then(json => {
if(json !== null) console.log("- ✅ getCharacterByName tested")
else console.log("- ❌ getCharacterByName tested")
});
WarcraftLog.getCharacterById(999).then(json => {
if(json !== null) console.log("- ✅ getCharacterById tested")
else console.log("- ❌ getCharacterById tested")
});
WarcraftLog.getGuildByName("guildname", "serverslug", "region").then(json => {
if(json !== null) console.log("- ✅ getGuildByName tested")
else console.log("- ❌ getGuildByName tested")
});
WarcraftLog.getGuildById(999).then(json => {
if(json !== null) console.log("- ✅ getGuildById tested")
else console.log("- ❌ getGuildById tested")
});
WarcraftLog.getReportByCode("report_code").then(json => {
if(json !== null) console.log("- ✅ getReportByCode tested")
else console.log("- ❌ getReportByCode tested")
});
WarcraftLog.getReportsByGuild("guildname", "serverslug", "region").then(json => {
if(json !== null) console.log("- ✅ getReportsByGuild tested")
else console.log("- ❌ getReportsByGuild tested")
});
Contributing
Anyone can contribute via Github Pull Request
Issues
Any issue had to be reported in Github Issues