0.2.2 • Published 1 year ago

warcraftlog-api-v2 v0.2.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Warcraft Log API V2

This package allow you to simply fetch data from the GraphQL API of WarcraftLog.

Build

GitHub Actions Workflow Status GitHub package.json version (branch)

Issues / Pull Requests

GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub Issues or Pull Requests GitHub Issues or 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

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago