/paladins.js

A NodeJS/NPM module for getting resources from the Paladins API.

Primary LanguageTypeScriptApache License 2.0Apache-2.0

paladins.js

NPM License Downloads

Paladins.js is a package that helps Hi-Rez/Paladins developers communicate with the API.

2.0

v2.0 is a complete rewrite of the current paladins.js library. It is not backwards compatible with any version prior.

Differences between 1.x / 2.x:

  • The complicated cache process has been redone
  • You can pass through more options
  • Proper error handling
  • Returns promises with proper JSON
  • and more...

Install

$ npm install paladins.js

Usage

TypeScript

import { API } from 'paladins.js';

let api = new API({
    devId: '1234',
    authKey: 'abcd1234'
}); // API loaded and ready to go. 

api.getDataUsage()
    .then((response: any) => {
        // Do something with response
    })
    .catch((err: any) => {
        // Handle the error
    });

JavaScript

const paladinsJS = require('paladins.js');

let api = new paladinsJS.API({
    devId: '1234',
    authKey: 'abcd1234'
}); // API loaded and ready to go. 

api.getDataUsage()
    .then((response: any) => {
        // Do something with response
    })
    .catch((err: any) => {
        // Handle the error
    });

Documentation / Methods

You can view all the available methods and documentation on the PaladinsDev website.