@quoriel/pterodactyl
v1.1.0
Published
ForgeScript extension for interacting with the Pterodactyl API (Client Category)
Readme
QuorielPterodactyl
A convenient extension for ForgeScript that provides a complete set of functions for interacting with the Pterodactyl API (Client Category).
Installation
npm i github:quoriel/pterodactylConnection
const { ForgeClient } = require("@tryforge/forgescript");
const { QuorielPterodactyl } = require("@quoriel/pterodactyl");
const client = new ForgeClient({
extensions: [
// Configuration for your Pterodactyl panels
new QuorielPterodactyl({
"main_panel": {
"url": "PTERO_URL",
"key": "PTERO_KEY"
},
"second_panel": {
"url": "SECOND_PTERO_URL",
"key": "SECOND_PTERO_KEY",
"headers": {
"User-Agent": "Quoriel/1.0"
}
}
})
]
});
client.login("...");Configure Environment Variables
The url and key values are not specified directly in the code. Instead, you provide the names of environment variables that hold these values. This is a security best practice.
Create a .env file in your project's root directory and add your credentials:
# Credentials for the "main_panel" configuration
PTERO_URL=panel.example.com
PTERO_KEY=ptlc_YourSuperSecretApiKeyHere
# Credentials for the "second_panel" configuration
SECOND_PTERO_URL=another-panel.net
SECOND_PTERO_KEY=ptlc_AnotherApiKeyFromSecondPanelNote The key in the configuration object (e.g.,
main_panel) is the identifier you will use in functions to specify which panel to send the request to. https://panel.example.com/api/client // Header Authorization: Bearer ptlc_YourSuperSec.......
