@uplinkxyz/erlc
v0.2.2
Published
TypeScript client for the ER:LC Private Server API
Downloads
789
Maintainers
Readme
@uplinkxyz/erlc
TypeScript client for the ER:LC Private server API.
Install
bun add @uplinkxyz/erlcUsage
import { ERLCClient } from '@uplinkxyz/erlc'
const client = new ERLCClient({ serverKey: process.env.ERLC_SERVER_KEY! })
const server = await client.getServer({ players: true, killLogs: true })
console.log(server.CurrentPlayers, server.Players)
await client.runCommand(':h Hello from Uplink!')Public applications
If you've registered a Public Application pass its token as apiKey:
const client = new ERLCClient({
serverKey: userSuppliedServerKey,
apiKey: process.env.ERLC_APP_TOKEN!,
})API
getServer(options?)- full server status, options areplayers,staff,joinLogs,queue,killLogs,commandLogs,modCalls,emergencyCalls, &vehiclesgetPlayers(),getStaff(),getJoinLogs(),getQueue(),getKillLogs(),getCommandLogs(),getModCalls(),getEmergencyCalls()&getVehicles()runCommand(command: string)- run an in-game command as virtual server management.parsePlayer("Name:12345")- parses ER:LC's"Name:Id"string format used throughout the API.
Errors
All errors extend ERLCApiError (status, code?, commandId?, & body):
ERLCAuthError- unauthorizedERLCBadRequestError- 400ERLCServerOfflineError- 422, server emptyERLCUpstreamError- 500, couldn't reach robloxERLCRateLimitError- 429
Current Maintainers
@LxghtBlvee
