Skip to content

K0bus/warcraftlog-api-v2

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published