Skip to content

@kyizl/craftify

Typed, runtime-validated API wrapper for PikaNetwork.

A quick look ​

ts
import { Gamemode, PikaNetworkClient, Stat } from '@kyizl/craftify';

const client = new PikaNetworkClient();

const leaderboard = await client.getLeaderboard({
  gamemode: Gamemode.BedWars,
  stat: Stat.BedWars.Kills,
  page: 1,
  limit: 10,
});

const player = await client.getProfile('divena');
const stats = await client.getProfileStats({
  username: 'divena',
  gamemode: Gamemode.BedWars,
});
const finals = stats.StatKey.BedWars.FinalKills;

const clan = await client.getClan('THEBOIS');
const recap = await client.getMatchRecap('8b17beb5-e8be-489f-b083-fed74ad8d7d7');

const players = await client.getProfiles(['divena', 'resuns', 'Si1ent_']);
const [clan_batch, profile_batch, recap_batch] = await client.batch([
  () => client.getClan('THEBOIS'),
  () => client.getProfile('divena'),
  () => client.getMatchRecap('8b17beb5-e8be-489f-b083-fed74ad8d7d7'),
]);

Start with the Getting Started guide, review the API Reference for the client types, or inspect the PikaNetwork API reference for the underlying HTTP contract.

Distributed under the MIT License.