npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ronaldmiranda/api-sdk

v1.4.2

Published

SDK oficial para integração com a RNLD API — whitelist e query de jogadores

Readme

@ronaldmiranda/api-sdk

SDK oficial para integração com a RNLD API — permite que criadores de bots Discord consultem e gerenciem whitelists de servidores FiveM.

Instalação

npm install @ronaldmiranda/api-sdk

Início rápido

import { RnldClient } from '@ronaldmiranda/api-sdk';

const client = new RnldClient({
  apiKey: 'SUA_API_KEY',
  guildId: 'ID_DA_GUILD',
});

Rotas disponíveis

whitelist.query(params) — consultar jogador

Consulta o status de whitelist de um jogador. Retorna null se não encontrado.

const player = await client.whitelist.query({ discordId: '123456789012345678' });

if (!player) {
  console.log('Jogador não encontrado');
} else {
  console.log(player.isStaff);      // boolean
  console.log(player.isBanned);     // boolean
  console.log(player.banReason);    // string
  console.log(player.identities);   // { wl_id, discord_id, steamHex, license, ... }
}

Parâmetros (ao menos um obrigatório):

| Campo | Tipo | Descrição | |-------------|--------|------------------------------| | wl_id | string | Token amigável do jogador | | discordId | string | Discord ID | | steam | string | Steam Hex | | license | string | License principal (Rockstar) | | license2 | string | License secundária |


whitelist.liberar(params) — liberar jogador

Adiciona o jogador à whitelist.

const resultado = await client.whitelist.liberar({
  wl_id: 'TOKEN_DO_JOGADOR',
  discordId: '123456789012345678', // opcional
});

console.log(resultado.status);   // true | false
console.log(resultado.mensagem); // descrição do resultado

whitelist.remover(params) — remover whitelist

Remove a whitelist de um jogador.

const resultado = await client.whitelist.remover({ wl_id: 'TOKEN_DO_JOGADOR' });

whitelist.ban(params) — banir jogador

Bane um jogador. reason é opcional.

const resultado = await client.whitelist.ban({
  wl_id: 'TOKEN_DO_JOGADOR',
  reason: 'Uso de cheats', // opcional
});

console.log(resultado.status);   // true | false
console.log(resultado.mensagem);

| Campo | Tipo | Obrigatório | Descrição | |----------|--------|-------------|--------------------| | wl_id | string | sim | Token do jogador | | reason | string | não | Motivo do banimento |


whitelist.desban(params) — desbanir jogador

Remove o banimento de um jogador.

const resultado = await client.whitelist.desban({ wl_id: 'TOKEN_DO_JOGADOR' });

console.log(resultado.status);   // true | false
console.log(resultado.mensagem);

Tratamento de erros

import { RnldApiError, RnldNotFoundError, RnldUnauthorizedError } from '@ronaldmiranda/api-sdk';

try {
  await client.whitelist.liberar({ wl_id: 'TOKEN' });
} catch (err) {
  if (err instanceof RnldUnauthorizedError) {
    // API Key inválida ou guild_id incorreto
  } else if (err instanceof RnldNotFoundError) {
    // Jogador não existe
  } else if (err instanceof RnldApiError) {
    console.error(err.statusCode, err.message, err.body);
  }
}

Nota: whitelist.query() não lança RnldNotFoundError — retorna null em caso de 404. Os demais métodos (liberar, remover, ban, desban) lançam o erro normalmente.


Configuração

| Opção | Tipo | Obrigatório | Descrição | |--------------|--------|-------------|------------------------------------------------------------------| | apiKey | string | sim | API Key do servidor (header x-api-key) | | guildId | string | sim | ID da guild Discord |

Exemplo — bot Discord

Veja um bot completo com discord.js em example/bot.js.

cd example
cp .env.example .env   # preencha as variáveis
npm install
npm start

Comandos registrados automaticamente na guild:

| Comando | Descrição | |---|---| | /wl-status | Consulta whitelist por discord_id ou wl_id | | /wl-liberar | Libera a whitelist de um jogador | | /wl-remover | Remove a whitelist de um jogador | | /wl-ban | Bane um jogador (motivo opcional) | | /wl-desban | Desbane um jogador |

Build

npm run build