mirror of
https://github.com/vyme-fr/MercuryCloud_Dashboard.git
synced 2026-01-19 00:57:23 +01:00
PteroJS
A better API wrapper for Pterodactyl
About
PteroJS is a flexible API wrapper designed to give developers full access over the Pterodactyl API. The library uses a class-based management structure often seen in popular packages like Discord.js which keeps code clean, efficient and practical for any use-case.
Installing
npm install @devnote-dev/pterojs
Please join the support server if you experience package installation issues.
Setting Up
PteroJS uses separate classes for the client and application sides of the Pterodactyl API.
Using the application API
const { PteroApp } = require('@devnote-dev/pterojs');
// Initialising the application
const client = new PteroApp('your.domain.here', 'pterodactyl_api_key');
// Accessing information
client.servers.fetch('evuk98yu').then(console.log);
Using the client API
const { PteroClient } = require('@devnote-dev/pterojs');
// Initialising the client
const client = new PteroClient(
'your.domain.here',
'pterodactyl_api_key',
{ ws: true }
);
// Adding the server to listen for
const shard = client.addSocksetServer('kgujg66h');
// Listening to events
shard.on('statusUpdate', status => {
console.log(`server ${shard.id} status: ${status}`);
});
// Connecting to the server
shard.connect();
Contributing
Please see the todo list or issues section for contributing ideas. New ideas are also welcome.
- Fork this repo!
- Make a branch from
main(git branch -b <new-feature>) - Commit your changes (
git commit -am "...") - Open a PR here (
git push origin <new-feature>)
Contributors
- Devonte - Owner, maintainer
- Chelog - Code contributor
- Cain - Code contributor
- Zumo - Tester
- Dino - Tester
This repository is managed under the MIT license.
© 2021-2022 devnote-dev