Skip to main content
The client.events resource exposes the in-game event log — a stream of timestamped activity records covering everything that happens to a character, faction, inventory, or in combat. You filter by eventMode to select the scope of events you want and by eventType to narrow down to specific activity types. Use this resource to build activity dashboards, audit logs, or combat reporters.
The events endpoint uses 0-based start_index (start with start_index: 0 for the first page). This is the only resource in the SDK that does not use 1-based pagination. All other resources start at start_index: 1.

Listing events

events.list()

Returns a paginated list of game events filtered by mode and type.
eventMode
string
required
The scope of events to return. Must be one of:
  • character — events related to a character’s personal activity
  • faction — events related to faction operations
  • inventory — events related to entities in the character’s inventory
  • combat — combat-related events
eventType
string
required
The type of event to filter for. Use "all" to return all event types within the selected mode, or pass a specific type string.
start_index
number
default:"0"
0-based index of the first event to return. Use 0 for the first page.
item_count
number
default:"50"
Number of events per page.
// List all character events
const events = await client.events.list({
  eventMode: 'character',
  eventType: 'all',
  start_index: 0,
});

console.log(events.total);

for await (const event of events) {
  console.log(event.type, event.description, event.timestamp);
}
// List faction events only
const factionEvents = await client.events.list({
  eventMode: 'faction',
  eventType: 'all',
  start_index: 0,
  item_count: 25,
});
// List combat events
const combatEvents = await client.events.list({
  eventMode: 'combat',
  eventType: 'all',
  start_index: 0,
});

Getting a single event

events.get()

Retrieves a single game event by its UID.
uid
string
required
The event UID in "type:id" format.
const event = await client.events.get({ uid: '5:99001' });

console.log(event.type);
console.log(event.description);
console.log(event.timestamp);

0-based pagination

The events endpoint is unique in the SDK: it uses 0-based indexing for start_index. The first page is start_index: 0, the second page starts at item_count, and so on. If you use for await...of, the SDK handles this automatically — but if you paginate manually, be sure to start at 0.
// Manual pagination — note start_index starts at 0
let startIndex = 0;
const pageSize = 50;

while (true) {
  const page = await client.events.list({
    eventMode: 'character',
    eventType: 'all',
    start_index: startIndex,
    item_count: pageSize,
  });

  for (const event of page.data) {
    process(event);
  }

  if (!page.hasMore) break;
  startIndex += pageSize;
}
When using for await...of, you do not need to manage start_index yourself — the SDK advances it correctly regardless of whether the endpoint uses 0-based or 1-based indexing.

Event modes

ModeDescription
characterPersonal activity for the authenticated character: movement, communication, transactions
factionFaction-level operations: member changes, credits, production
inventoryActivity involving entities in the character’s inventory: ship movements, repairs
combatCombat engagements, battle outcomes, and damage reports

Full example

import { SWCombine } from 'swcombine-sdk';

const client = new SWCombine({ token: process.env.SWC_ACCESS_TOKEN! });

// Stream the last 100 character events
const events = await client.events.list({
  eventMode: 'character',
  eventType: 'all',
  start_index: 0,
  item_count: 100,
});

console.log(`${events.total} total character events`);

for (const event of events.data) {
  console.log(`[${event.timestamp}] ${event.type}: ${event.description}`);
}

Character

Fetch character profiles referenced in events.

Faction

Retrieve faction details for faction-mode events.

Inventory

Inspect the inventory entities involved in inventory events.

Pagination

Understand 0-based indexing and the Page<T> pattern.