1.0.17 • Published 11 months ago

pixelic-api-wrapper v1.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Links

Discord Support | NPM | GitHub

Install

npm i pixelic-api-wrapper
const PixelicAPI = require("pixelic-api-wrapper");

Quick Start

To be able to use the Pixelic-API via the Pixelic-API-Wrapper you still need to generate an API-Key. Instructions on how to generate an API-Key can be found here : https://docs.pixelic.de

Step 1 of 2

const pixelicAPI = new PixelicAPI("HERE-YOUR-KEY-GOES");

Step 2 of 2

➤ Using promises?

pixelicAPI
  .getDaily("Pixelic")
  .then((dailyData) => {
    /* process data */
  })
  .catch((error) => {
    /* handle error */
  });

➤ Using async/await?

try {
  const dailyData = await pixelicAPI.getDaily("Pixelic");
  /* process data */
} catch (error) {
  /* handle error */
}

Docs

Constructor

const pixelicAPI = new PixelicAPI("API-KEY", {
  /* options */
});

Basic options:

OptionDefaultDescription
ratelimit60Set how many "normal" Requests you want to send per Minute.
leaderboardRatelimit10Set how many Leaderboard Requests you want to send per Minute.
registerRatelimit5Set how many Register Requests you want to send per 5-Minutes.
checkForUpdatestrueSet whether to check for Updates on start.
redis.hostnullRedis-Host (Used for Clustered-Ratelimiting)
redis.portnullRedis-Port (Used for Clustered-Ratelimiting)
redis.usernamenullRedis-Username (Used for Clustered-Ratelimting)
redis.passwordnullRedis-Password (Used for Clustered-Ratelimiting)

Clustered-Ratelimiting with Redis

const pixelicAPI = new PixelicAPI("API-KEY", {
  redis: {
    host: "10.0.0.10",
    port: 6379,
    username: "default",
    password: "",
  },
});
1.0.17

11 months ago

1.0.16

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago