An Efficient and Fully Compliant Pterodactyl API Wrapper

An Efficient and Fully Compliant Pterodactyl API Wrapper

Ptereno provides all the tools you need to manage your Pterodactyl instances. With full coverage over all client/application endpoints, you can access and modify any data, as well as manage realtime events through websockets.

Ptereno

An efficient and fully compliant Pterodactyl API wrapper.

The library is currently in release candidate phase, you may use this library in production but expect bugs. If you encounter any issues, please make an issue or a pull request.

Why Ptereno?

Ptereno provides all the tools you need to manage your Pterodactyl instances. With full coverage over all client/application endpoints, you can access and modify any data, as well as manage realtime events through websockets.

Features

  • Full coverage for all client/application routes
  • WebSockets for handling realtime server events
  • Type-strict responses

Breakdown

It is recommended that you have a basic understanding of your panel before you decide to use this library.

In Pterodactyl, there are 2 possible API route groupings which are represented with their respective classes (Client and Application).

The client is a collection of endpoints for managing your panel from a client account. The data from these endpoints only provide what you need to manage your servers and your account. (You can create API keys here: https://pterodactyl.app/account/api)

The application is for administrative-specific endpoints. The application routes require more fine-tuned access and contains more information about servers, eggs, nests, nodes, and other structures. (You can create API keys here: https://pterodactyl.app/admin/api)

Documentation

If you find any issues with the library, please make a new issue or pull request.

Currently, there is no official documentation, but you can always use the deno documentation generator.

Examples

Below are a few basic examples, but you can find the rest here.

Client

The example below shows a how to get information from the client account.

import { Client } from "https://deno.land/x/ptereno/mod.ts";

const client = new Client("<URL>", "<TOKEN>");

const account = await client.getAccount();

console.log(account);
//  {
//    id: 0,
//    admin: true,
//    username: "Alanexei",
//    email: "[email protected]",
//    first_name: "Alan",
//    last_name: "Dev",
//    language: "en"
//  }

Application

The example below shows how you can get user information from an application.

import { Application } from "https://deno.land/x/ptereno/mod.ts";

const app = new Application("<URL>", "<TOKEN>");

const user = await app.getUser(0);

console.log(user);
//  {
//    id: 0,
//    external_id: null,
//    uuid: "ABCDEFGH-1234-5678-9012-ABCDEFGHIJKL",
//    username: "Alanexei",
//    email: "[email protected]",
//    first_name: "Alan",
//    last_name: "Dev",
//    language: "en",
//    root_admin: true,
//    2fa: true,
//    created_at: "1970-01-01T00:00:00.000Z",
//    updated_at: "1970-01-01T00:00:00.000Z"
//  }

Sockets

The example below demonstrates the server socket system.

import { Client } from "https://deno.land/x/ptereno/mod.ts";

const client = new Client("<URL>", "<TOKEN>");
const ws = client.joinServerSocket("<SERVER>");

ws.on("open", () => {
  console.log("Socket Open");
});

ws.on("close" (code, reason) => {
  console.log(`Socket Closed - ${code} ${reason}`);
});

ws.on("output", (msg) => {
  console.log(msg);
});

Disclaimer

The contributors of Ptereno are not responsible for any damage you cause on your Pterodactyl instances. Be cautious of certain endpoints, as for some can cause severe damage.

All credit for the logo elements go to Deno and Pterodactyl; however, this library has no affiliation with either source.

Download Details:

Author: Alanexei

Source Code: https://github.com/Alanexei/Ptereno

deno nodejs node javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

AEM Querybuilder for JavaScript (Browser, Node, Deno)

Helix Querybuilder .AEM Querybuilder for JavaScript (Browser, Node, Deno)

NKeys for JavaScript - Node.js, Browsers, and Deno

A public-key signature system based on Ed25519 for the NATS ecosystem system for JavaScript. The nkeys.js library works in Deno, Node.js, and the browser!

Javascript module for easily generating mazes,compatible with both Deno and Node

A work-in-progress Javascript maze generator module, compatible with both Deno and Node.

Deno Tutorial for Beginners: Deno vs. Node: Better Than NodeJS?

Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.

What is Deno? The Node.JS Killer? The Deno-minator to Node?

What is Deno? The Node.JS Killer? The Deno-minator to Node? Deno is the new hype and will it be better than node.js? Deno is a secure runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language that addresses Node’s shortcomings