Registry / devops / paldefender-rest-client

paldefender-rest-client

JSON →
library0.1.6jsnpmunverified

TypeScript API wrapper for the PalDefender REST API, version 0.1.6. Provides a type-safe, high-level interface to manage Palworld game servers via PalDefender. Features include 'Smart Input' that accepts multiple formats for item/pal/egg granting (shorthand strings, arrays, detailed objects, tuples) with automatic deduplication. Covers player info, server info, item gifting, pal gifting, egg gifting, technology learning/forgetting, and progression granting. Has no known release cadence yet but ships TypeScript definitions. Differentiates by its flexible parameter handling compared to lower-level REST clients.

npm install paldefender-rest-client
INSTALL
IMPORT
SIG · PALDEFENDER-REST-C
P
paldefender-rest-client
devopsjavascriptv0.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PalDefenderClient
import { PalDefenderClient } from 'paldefender-rest-client'
const PalDefenderClient = require('paldefender-rest-client').PalDefenderClient
Default export is not available; must use named import. ESM only.
PalId
import { PalId } from 'paldefender-rest-client'
import PalId from 'paldefender-rest-client'
PalId is an exported enum, not a default export.
IPalDefenderClientOptions
import type { IPalDefenderClientOptions } from 'paldefender-rest-client'
import { IPalDefenderClientOptions } from 'paldefender-rest-client'
Use type import for TypeScript interfaces to avoid unnecessary runtime code.

Initializes a PalDefenderClient with token, host, and port; demonstrates listing players and granting items/pals with flexible parameter input.

import { PalDefenderClient, PalId } from 'paldefender-rest-client'; const client = new PalDefenderClient({ token: process.env.PALDEFENDER_TOKEN ?? '', host: '127.0.0.1', port: 17993 }); async function main() { // List players const { players } = await client.players(); console.log(players); // Give items using Smart Input (shorthand, array, objects all work) await client.giveItems('steam_76561198000000000', 'Stone', { ItemId: 'Stone', Count: 5 }); // Give a pal using PalId enum await client.givePals('steam_76561198000000000', PalId.Jetragon, { PalName: 'Anubis', Level: 50 }); } main().catch(console.error);
Debug
Known issues
gotchaMac player IDs are currently broken. Use PlayerUID for Mac players.
fix
Use the internal Palworld GUID (PlayerUID) instead of Mac user ID.
affects: >=0.0.0
gotchaThe method `players()` returns both online and offline players. Filtering is not provided.
fix
Manually filter the returned array using player's online status if needed.
affects: >=0.0.0
gotchaVersion badges in README show npm v11.12.1 and node v24.14.1 which are likely incorrect or placeholders.
fix
Ignore version badges; use actual npm package version (0.1.6).
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'paldefender-rest-client' or its corresponding type declarations.
Package not installed or TypeScript cannot resolve the types.
fix
Run 'npm install paldefender-rest-client' and ensure the package is in node_modules.
TypeError: client.players is not a function
Incorrect instantiation or method name. (Note: players is an alias for getPlayers)
fix
Ensure you created a client instance correctly and call either client.players() or client.getPlayers().
Property 'PalId' does not exist on type 'typeof import("...")'.
Importing incorrectly (e.g., default import instead of named).
fix
Use 'import { PalId } from 'paldefender-rest-client''.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
Amazon
1
Resources
paldefender-rest-client — npm install paldefender-rest-client · libregistry