pterodactyl-api.js is a simple node.js module to simplify the communication with the pterodactyl REST API. Currently, it only supports all /api/application/users & /api/application/servers methods.
Use the package manager npm to install pterodactyl-api.js.
npm install pterodactyl-api.jsSee more detailed examples in the examples directory.
const pterodactylApi = require('pterodactyl-api.js');
const api = new pterodactylApi('PANEL_URL_OR_IP', 'API_TOKEN');
async function runMain() {
try {
await api.deleteUser('1');
} catch (error) {
console.error(error);
}
}
runMain();All parameters that are sent to pterodactyl's API are named the same as you can see here at the different endpoints.
This module was based on this.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.