@sryden/nebula
v1.0.0
Published
Node.js wrapper for the Pterodactyl API
Downloads
2
Readme
SRYDEN Nebula
Node.js wrapper for the Pterodactyl API. This isn't fully finished, actions such as edit are not added.
Installation
Install with npm:
npm install @sryden/nebula
Usage
const nebula = require('@sryden/nebula');
nebula.config({
panel: 'https://pterodactyl.test',
apikey: 'ptla_xxxxxxxxxxxxxxxxxxxx',
});
// Note: Use an admin API key, not a client one
// Example: Get server list
nebula.servers.list()
.then((serverList) => console.log('Server List:', serverList))
.catch((error) => console.error('Error:', error));
// Example: Get details of a server
nebula.servers.getDetails(1)
.then((serverDetails) => console.log('Server Details:', serverDetails))
.catch((error) => console.error('Error:', error));
// Example: Create a new server
const newServer = {
name: 'Kinetic Nibbler',
user: 1,
// Add other server details as per ptero API documentation
// Not all are necessary, keep that in mind
};
nebula.servers.create(newServer)
.then((createdServer) => console.log('Created Server:', createdServer))
.catch((error) => console.error('Error:', error));
// Similar usage for nodes and users, refer to the ptero API documentation for more details
Configuration
Before using Nebula, make sure to configure it with your Pterodactyl panel URL and API key:
nebula.config({
panel: 'https://pterodactyl.test',
apikey: 'ptla_xxxxxxxxxxxxxxxxxxxx',
});
Replace the placeholder config with your actual Pterodactyl panel URL and API key.