npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@akaanakbaik/pterodactyl-gateway

v1.0.2

Published

TypeScript SDK dan CLI untuk Pterodactyl Panel: create user/server, bot integration, dashboard automation, file manager, backups, schedules, dan server control.

Readme

Akadev Pterodactyl Gateway

Akadev Pterodactyl Gateway membantu kamu menghubungkan aplikasi Node.js ke Pterodactyl Panel dengan flow yang lebih aman, cepat, dan mudah diuji: cek koneksi, membuat user, membuat server, dry-run payload, mengelola file, startup variables, backups, schedules, power action, sampai helper integrasi bot/website.

Package ini bukan package resmi dari Pterodactyl dan tidak berafiliasi dengan Pterodactyl Software.

Web Docs

Dokumentasi lengkap versi web tersedia di:

https://web-docs-pterodacty-gateway.vercel.app

Web docs berisi tutorial per halaman/path agar mudah dipahami pemula:

/docs/overview
/docs/install
/docs/config
/docs/cli-create-server
/docs/sdk
/docs/integrations/telegram-bot
/docs/integrations/whatsapp-bot
/docs/integrations/discord-bot
/docs/integrations/website-api
/docs/security
/docs/troubleshooting
/privacy
/terms

Fitur web docs:

  • Search lokal cepat.
  • Floating AI assistant untuk pertanyaan seputar gateway.
  • Tutorial step-by-step.
  • Simulasi animasi penggunaan.
  • Contoh integrasi Telegram bot, WhatsApp bot, Discord bot, website/API, SDK, CLI, dan troubleshooting.
  • Privacy Policy dan Terms.
  • SEO lengkap: sitemap, robots, canonical, OpenGraph, Twitter card, JSON-LD, manifest, dan SVG icon.

Navigasi

Install

Install sebagai dependency project:

npm i @akaanakbaik/pterodactyl-gateway

Install global CLI:

npm i -g @akaanakbaik/pterodactyl-gateway

Cek instalasi:

ptero-gateway version
ptero-gateway self-check
ptero-gateway release-check

Quick start CLI

ptero-gateway config init \
  --profile main \
  --domain https://panel.example.com \
  --ptla ptla_xxx \
  --ptlc ptlc_xxx

ptero-gateway doctor
ptero-gateway ids --nest 5
ptero-gateway admin users
ptero-gateway admin servers
ptero-gateway servers

Create server dengan dry-run:

ptero-gateway admin create-server \
  --name "aka test" \
  --email [email protected] \
  --username aka_test \
  --password "password aman" \
  --node 1 \
  --nest 5 \
  --egg 18 \
  --preset basic \
  --dry-run

Create server asli:

ptero-gateway admin create-server \
  --name "aka test" \
  --email [email protected] \
  --username aka_test \
  --password "password aman" \
  --node 1 \
  --nest 5 \
  --egg 18 \
  --preset basic \
  --yes

SDK usage

import { createPtero } from "@akaanakbaik/pterodactyl-gateway";

const ptero = createPtero.fromEnv();
const doctor = await ptero.doctor();
console.log(doctor);

Create server dari SDK:

const server = await ptero.servers.createSmart({
  name: "Bot User",
  email: "[email protected]",
  username: "user_bot",
  password: "auto",
  autoCreateUser: true,
  description: "Server bot user",
  nodeId: 1,
  nestId: 5,
  eggId: 18,
  specs: {
    memory: "1GB",
    disk: "2GB",
    cpu: "100%",
    databases: 0,
    allocations: 1,
    backups: 0
  }
});

Client server handle:

const serverHandle = ptero.server("311d56b7");

await serverHandle.resources();
await serverHandle.files.list("/");
await serverHandle.files.write("/tmp/hello.txt", "halo");
await serverHandle.startup.set("CMD_RUN", "node index.js");
await serverHandle.start();

Environment

Gunakan environment variable untuk deployment:

PTERO_DOMAIN=https://panel.example.com
PTERO_PTLA=ptla_xxxxxxxxxxxxxxxxx
PTERO_PTLC=ptlc_xxxxxxxxxxxxxxxxx

| Env | Fungsi | |---|---| | PTERO_DOMAIN | Domain panel Pterodactyl. | | PTERO_PTLA | Application API Key untuk aksi admin seperti user, server, suspend, limits. | | PTERO_PTLC | Client API Key untuk kontrol server, file manager, backups, schedules, resources. |

Tips:

  • PTLA hanya untuk backend/admin service.
  • PTLC hanya untuk fitur client server yang diperlukan.
  • Jangan hardcode key ke source code, repo, frontend, pesan bot, atau log publik.
  • Pisahkan key development dan production.

CLI reference

Health dan info:

ptero-gateway help
ptero-gateway version
ptero-gateway self-check
ptero-gateway release-check
ptero-gateway doctor
ptero-gateway connect
ptero-gateway ids
ptero-gateway ids --nest 5

Admin:

ptero-gateway admin users
ptero-gateway admin servers
ptero-gateway admin server 5 detail
ptero-gateway admin server 5 limits
ptero-gateway admin server 5 update-limits --backups 1 --yes
ptero-gateway admin server 5 suspend --yes
ptero-gateway admin server 5 unsuspend --yes
ptero-gateway admin server 5 reinstall --yes

Client server:

ptero-gateway probe 311d56b7
ptero-gateway server 311d56b7 summary
ptero-gateway server 311d56b7 resources
ptero-gateway server 311d56b7 files /
ptero-gateway server 311d56b7 read /package.json
ptero-gateway server 311d56b7 env
ptero-gateway server 311d56b7 ports
ptero-gateway server 311d56b7 databases
ptero-gateway server 311d56b7 backups
ptero-gateway server 311d56b7 schedules

Power dan command:

ptero-gateway server 311d56b7 start --yes
ptero-gateway server 311d56b7 stop --yes
ptero-gateway server 311d56b7 restart --yes
ptero-gateway server 311d56b7 kill --yes
ptero-gateway server 311d56b7 command "npm start" --yes

Preset dan template

ptero-gateway presets
ptero-gateway templates list
ptero-gateway templates show nodejs-bot
ptero-gateway templates command nodejs-bot --name "bot saya" --email [email protected] --node 1 --nest 5 --egg 18

Preset bawaan:

| Preset | Cocok untuk | |---|---| | mini | Testing dan bot kecil. | | basic | Bot Telegram/Discord sederhana. | | standard | Bot WhatsApp, API, website kecil. | | premium | Project lebih aktif. | | unlimited | Resource unlimited sesuai aturan panel. |

Template bawaan:

nodejs-bot
nodejs-api
wa-bot
python-bot
blank

Integration helpers

Helper integrasi membuat input server lebih konsisten untuk bot dan website.

import { createIntegrationService } from "@akaanakbaik/pterodactyl-gateway";

const service = createIntegrationService({
  domain: process.env.PTERO_DOMAIN,
  ptla: process.env.PTERO_PTLA,
  ptlc: process.env.PTERO_PTLC
}, {
  nodeId: 1,
  nestId: 5,
  eggId: 18,
  preset: "standard",
  autoCreateUser: true
});

const dryRun = await service.dryRun({
  kind: "telegram-bot",
  name: "Telegram Bot User",
  email: "[email protected]",
  username: "user_tg",
  password: "auto"
});

Kind yang tersedia:

"whatsapp-bot" | "telegram-bot" | "discord-bot" | "nodejs-api" | "website" | "python-bot" | "blank"

Contoh integrasi

Telegram bot:

const result = await service.create({
  kind: "telegram-bot",
  name: `tg-${ctx.from.id}`,
  email: `${ctx.from.id}@telegram.local`,
  username: `tg_${ctx.from.id}`,
  password: "auto"
});

WhatsApp bot:

const result = await service.create({
  kind: "whatsapp-bot",
  name: `wa-${order.username}`,
  email: order.email,
  username: order.username,
  password: "auto",
  environment: {
    OWNER_NUMBER: order.phone,
    BOT_NAME: order.botName
  }
});

Website/API:

app.post("/api/panel/create", async (req, res) => {
  const paid = await checkPayment(req.body.orderId);
  if (!paid) return res.status(403).json({ ok: false, error: "Belum dibayar" });

  const result = await service.create({
    kind: "website",
    name: req.body.name,
    email: req.body.email,
    username: req.body.username,
    password: "auto"
  });

  res.json({ ok: true, result });
});

Dokumentasi contoh lengkap ada di web docs:

https://web-docs-pterodacty-gateway.vercel.app/docs/integrations/telegram-bot
https://web-docs-pterodacty-gateway.vercel.app/docs/integrations/whatsapp-bot
https://web-docs-pterodacty-gateway.vercel.app/docs/integrations/discord-bot
https://web-docs-pterodacty-gateway.vercel.app/docs/integrations/website-api

Keamanan

  • Jangan hardcode PTLA/PTLC.
  • Jangan kirim API key atau config profile ke user.
  • Jangan log password generated ke public log.
  • Semua aksi tulis/ubah via CLI wajib --yes.
  • Write file CLI default hanya boleh ke /tmp; path lain wajib --allow-any-path.
  • Command berbahaya diblokir oleh guard command.
  • Delete user/server permanen tidak dibuka di CLI stabil.
  • Command node/location/allocation management tidak dibuka di CLI stabil.
  • Frontend tidak boleh memegang API key panel. Gunakan backend untuk semua aksi create server.

Troubleshooting

ptero-gateway explain DOMAIN_REQUIRED
ptero-gateway explain DOCKER_IMAGE_NOT_FOUND
ptero-gateway explain STARTUP_VARIABLE_NOT_FOUND
ptero-gateway explain EEXIST

Masalah umum:

| Masalah | Solusi | |---|---| | DOMAIN_REQUIRED | Isi PTERO_DOMAIN atau jalankan ptero-gateway config init. | | PTLA tidak valid | Buat ulang Application API Key dan pastikan permission cukup. | | PTLC tidak valid | Buat ulang Client API Key dari account panel. | | Docker image tidak ditemukan | Cek egg Docker Images atau isi --docker-image. | | Tidak ada allocation kosong | Tambahkan allocation dari panel admin node. | | Backup gagal limit 0 | Naikkan limit backup server dulu. | | Binary global konflik | Hapus /usr/bin/ptero-gateway, /usr/bin/ptg, lalu install ulang. |

Tutorial lengkap troubleshooting:

https://web-docs-pterodacty-gateway.vercel.app/docs/troubleshooting

Release dan testing

git clone https://github.com/akaanakbaik/pterodactyl-gateway.git
cd pterodactyl-gateway
npm install
npm run verify

Checklist publish:

npm run verify
npm publish --access public
npm view @akaanakbaik/[email protected] version --prefer-online --registry=https://registry.npmjs.org/
npm i -g @akaanakbaik/[email protected] --force --prefer-online --registry=https://registry.npmjs.org/
ptero-gateway self-check
ptero-gateway release-check
ptero-gateway doctor

Versi npm lama

Rilis utama yang direkomendasikan adalah 1.0.2 atau latest. Versi lama tidak dipromosikan lagi di dokumentasi.

Contoh deprecate versi lama:

npm deprecate @akaanakbaik/pterodactyl-gateway@"<1.0.0" "Versi lama tidak direkomendasikan. Gunakan @akaanakbaik/pterodactyl-gateway@latest."

Lisensi

MIT