MCPcopy Index your code
hub / github.com/PteroPackages/PteroJS

github.com/PteroPackages/PteroJS @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
557 symbols 1,044 edges 51 files 243 documented · 44%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

PteroJS

A verbose API library for Pterodactyl

About

PteroJS is a verbose API library for the Pterodactyl Game Panel designed to give developers full access and control over the API without having to compromise on code quality or efficiency.

Installing

If you are using Node.js (v14.x and above):

npm install @devnote-dev/pterojs
yarn add @devnote-dev/pterojs

or if you are using Deno:

import pterojs from 'https://cdn.skypack.dev/@devnote-dev/pterojs';

Please join the support server if you experience any issues with installing the package.

Compatibility

Note that you can use older versions of PteroJS with newer versions of Pterodactyl and Wings, but they will not be up-to-date with the latest features and fixes.

PteroJS Panel Wings
<= 0.7 <= 1.5
1.3.0 1.6.5 >= 1.7.0 ~1.6.0
1.4.2 1.7.0 >= 1.8.1 ~1.6.0
2.0.1 ^1.9.0 ^1.7.0
2.1.0 ^1.10.0 ^1.7.0

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 app = new PteroApp('your.domain.name', 'pterodactyl_api_key');

// Accessing information
app.servers.fetch(4).then(console.log);

Using the client API

const { PteroClient } = require('@devnote-dev/pterojs');

// Initialising the client
const client = new PteroClient('your.domain.name', 'pterodactyl_api_key');

// Adding the server to listen for
const shard = client.addSocketServer('f7eca02e');

// Listening to events
shard.on('statusUpdate', (status) => {
    console.log(`server ${shard.id} status: ${status}`);
});

// Connecting to the server
shard.connect();

Migrations

Checkout the new migrations guide to PteroJS v2!

Contributing

Please see the issues section for contributing ideas. New ideas/features are also welcome.

  1. Fork this repo!
  2. Make a branch from main (git branch -b <new-feature>)
  3. Commit your changes (git commit -am "...")
  4. Open a PR here (git push origin <new-feature>)

Contributors

This repository is managed under the MIT license.

© 2021-present PteroPackages

Extension points exported contracts — how you extend this code

APIErrorResponse (Interface)
(no doc)
src/structures/Errors.ts
Activity (Interface)
(no doc)
src/common/client.ts
ConvertOptions (Interface)
(no doc)
src/util/caseConv.ts
DictConstructor (Interface)
(no doc)
src/structures/Dict.ts
APIKey (Interface)
(no doc)
src/common/client.ts
AllowedQueryOptions (Interface)
(no doc)
src/util/query.ts
Backup (Interface)
(no doc)
src/common/client.ts
ClientMeta (Interface)
(no doc)
src/common/client.ts

Core symbols most depended-on inside this repo

get
called by 96
src/http/RequestManager.ts
post
called by 42
src/http/RequestManager.ts
set
called by 41
src/structures/Dict.ts
addEventListener
called by 31
docs/assets/main.js
create
called by 29
src/client/BackupManager.ts
add
called by 26
src/structures/Permissions.ts
emit
called by 24
src/client/ws/Shard.ts
map
called by 22
src/structures/Dict.ts

Shape

Method 397
Class 77
Interface 46
Function 34
Enum 3

Languages

TypeScript100%

Modules by API surface

docs/assets/main.js47 symbols
src/structures/User.ts33 symbols
src/structures/Dict.ts27 symbols
src/application/ApplicationServerManager.ts23 symbols
src/structures/Permissions.ts21 symbols
src/common/client.ts21 symbols
src/builders/Server.ts20 symbols
src/client/FileManager.ts19 symbols
src/http/RequestManager.ts18 symbols
src/builders/Node.ts18 symbols
src/client/ws/Shard.ts17 symbols
src/client/ClientServerManager.ts17 symbols

For agents

$ claude mcp add PteroJS \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact