The TypeScript SDK for ER:LC.
Manage servers, players, and console commands through one typed client.
server.ts
import { Client, ERLCEvents } from '@erlcjs/core';
const client = new Client({
servers: ['YOUR_SERVER_KEY'],
polling: { enabled: true },
});
client.on(ERLCEvents.playerJoin, (player) => {
player.message(`Welcome to ${player.server.info?.name}!`);
});
client.on(ERLCEvents.kill, (kill) => {
console.log(kill.killerUsername, 'killed', kill.killedUsername);
});
client.on('error', console.error);What's included.
Multi-server
One client owns many servers, each with its own cache and polling loop.
Typed events
Player, vehicle, call, and log events are inferred from the source.
Polling + webhooks
Poll for full state, or use the signed gateway for calls and custom commands.
Cached structures
Players, vehicles, staff, and logs are live objects with related-data getters.
Start in one file.
Install the package, add a server key, and subscribe to an event. The client handles polling and caching from there.
Read the getting started guideterminal
npm install @erlcjs/core
node index.jsPackages
Build your bot today.
Install the package and connect your first server in minutes.