Core

Client for the ER:LC API, with polling, webhooks, caches, and console commands.

#Classes

Class

Description

Ban

Represents a player banned from an ER:LC server.

BanManager

Manager responsible for fetching and caching the server's ban list.

Base

Represents the base class for all ER:LC structures.

Client

The main client for interacting with the ER:LC API and gateway. Manages multiple ER:LC game servers, each with its own caches and polling loop.

Collection

A collection class that extends the built-in Map class, providing additional utility methods for managing key-value pairs. K - The type of keys in the collection. V - The type of values in the collection.

CommandLog

Represents a logged command execution event.

CommandLogManager

Manager responsible for fetching, caching, and updating CommandLog structures.

CommandManager

Manager responsible for executing custom console commands in the ER:LC server.

CustomCommandError

Error thrown when a custom in-game command is invalid.

DuplicateServerError

Error thrown when two configured server keys resolve to the same server ID.

EmergencyCall

Represents an active emergency call in the ER:LC server.

EmergencyCallManager

Manager responsible for fetching, caching, and updating active EmergencyCall structures.

ERLCAPIError

Error thrown when the ER:LC API returns an error.

InvalidCommandError

Error thrown if the in-game command is invalid.

InvalidGlobalKeyError

Error thrown when an invalid ER:LC Global API Key is provided.

InvalidServerKeyError

Error thrown when an invalid ER:LC Server API Key is provided.

JoinLog

Represents a server join or leave log entry.

JoinLogManager

Manager responsible for fetching, caching, and updating JoinLog structures.

KillLog

Represents a log of a player death event (kill).

KillLogManager

Manager responsible for fetching, caching, and updating KillLog structures.

MissingGlobalAppIdError

Error thrown when an authorization link is requested without a global app ID.

ModCall

Represents a request for moderation help (moderator call) in the ER:LC server.

ModCallManager

Manager responsible for fetching, caching, and updating ModCall structures.

MultipleServersUnauthenticatedError

Error thrown when unauthenticated requests are made for multiple servers.

NoPlayersInServerError

Error thrown when a command is sent to a private server that has no players.

OutOfDateServerError

Error thrown when the server being accessed is out of date.

Player

Represents a player in the ER:LC server.

PlayerManager

Manager responsible for fetching, caching, and updating Player structures.

ProhibitedMessageError

Error thrown when the message sent is prohibited.

RestManager

Handles communication with the ER:LC HTTP API for all servers managed by a Client, managing rate limits and request queuing on a shared per-IP budget.

Buckets are gated conservatively: the server-reported remaining budget is reduced by tracked in-flight requests, and no request is dispatched while that effective budget is exhausted. A bucket's queue is frozen (with jittered backoff) while a Retry-After response is active, and window resets include a small safety buffer to avoid racing the server. In-flight concurrency is hard-capped to bound bursts.

RestrictedCommandError

Error thrown when the command is restricted.

RestrictedResourceError

Error thrown when the resource being accessed is restricted.

Server

Represents a single ER:LC game server managed by a Client. Holds the server's own managers, caches, polling loop, and webhook routing.

ServerBannedError

Error thrown if the server key is banned from accessing the ER:LC API.

ServerInfo

Represents the current configuration/state snapshot of an ER:LC game server.

ServerManager

Collection of the ER:LC game servers managed by a Client, keyed by server ID.

ServerNotConfiguredError

Error thrown when a webhook event targets a server that has no configured API key.

ServerOfflineError

Error thrown when the ER:LC Private Server is offline.

Staff

Represents a staff member.

StaffManager

Manager responsible for fetching, caching, and updating Staff structures.

TimeoutError

Error thrown when a timeout occurs.

UnauthorizedError

Error thrown if the request was unauthorized. This is normally thrown when the IP was not whitelisted or the global app was not authorized for that server. To authorize an IP go to https://api.erlc.gg/server-owners. To create a global app for an authorization link go to https://api.erlc.gg/developers/applications. To create an authorization link for your global app do console.log(server.authorizationLink).

Vehicle

Represents a spawned vehicle in the ER:LC server.

VehicleManager

Manager responsible for fetching, caching, and updating Vehicle structures.

WebhookServer

Webhook Server for handling real-time gateway events pushed by ER:LC for all managed servers. Incoming events are routed to the matching server by the top-level payload.server field.

#Enumerations

Enumeration

Description

ERLCEvents

Event names emitted by the erlcjs Client.

PlayerPermission

The permission levels a player can hold in an ER:LC server.

Vehicles

Enumeration of vehicle names available in ER:LC.

#Functions

Function

Description

convertToPascalCase(obj)

#Interfaces

Interface

Description

ClientEvents

Interface mapping client event names to their callback parameters.

ClientOptions

Configuration options for the ERLCApi Client.

CommandResponse

Response returned by the ER:LC command endpoint.

InGameCommand

In-Game command structure.

RawCommandLog

Raw data structure representing a executed command log entry.

RawEmergencyCall

Raw data structure representing an emergency call.

RawJoinLog

Raw data structure representing a server join/leave log entry.

RawKillLog

Raw data structure representing a kill log entry.

RawModCall

Raw data structure representing a moderator call log.

RawPlayerData

Raw data structure representing a player from the ERLC API.

RawServerData

Raw data structure representing the full server information payload from ER:LC.

RawStaffData

Raw data structure representing server staff records.

RawVehicle

Raw data structure representing a vehicle.

RawWebhookEmergencyCall

Raw data structure representing a webhook emergency call.

#Type Aliases

Type Alias

Description

RawBanList

Raw ban list returned by GET /v1/server/bans. Maps Roblox UserIds to usernames.

RawPlayerPermission

The raw permission values returned by the ER:LC API.