Skip to content

Quick Start

The HypixelAPI class allows you to communicate with the Hypixel API. Starboard supports both ESM and CommonJS imports:

js
import {HypixelAPI} from "@mcsb/api";
import {HypixelAPI} from "@mcsb/api";
js
const HypixelAPI = require("@mcsb/api").HypixelAPI;
const HypixelAPI = require("@mcsb/api").HypixelAPI;

The apiKey option is required when instantiating HypixelAPI. Hypixel API keys are v4 UUIDs used to authorize your application. You can request one on the Hypixel Developer Dashboard.

ts
const hypixel = await HypixelAPI.create({
    apiKey: "98cb0f8d-b14d-4b29-ae84-0a4d2bf35039"
})

const boosters = await hypixel.getBoosters() // HypixelBooster[]
const hypixel = await HypixelAPI.create({
    apiKey: "98cb0f8d-b14d-4b29-ae84-0a4d2bf35039"
})

const boosters = await hypixel.getBoosters() // HypixelBooster[]

Caching and request debouncing are both enabled by default. You can configure them in the options you pass to HypixelAPI. Check their documentation for more information:

Released under the MIT License.