Foxpile

Server-Sent Events

Realtime SSE

Subscribe to committed stock, faction, and token events with explicit filters.

Connect

fetch("https://compagnon-api.foxwar.net/api/events?events=stock.low,stock.critical&mapIds=DeadLandsHex&cityIds=ThePits&items=MaintenanceSupplies&minQuantity=20", {
  headers: { Authorization: `Bearer ${token}` },
});

Use an SSE client that supports request headers. Native browser EventSource cannot send a bearer header.

EventMeaning
stock.updatedAny committed quantity change.
stock.removedA public or reserve stockpile removed after seven days without an upload. Includes its last known content and remains access-filtered.
stock.lowA positive quantity matching the subscriber threshold.
stock.criticalA quantity reaching zero.
faction.updateA stockpile control change.
token.expireAn access token approaching expiry.

Discord delivery

The Foxpile bot consumes a trusted stream. It buffers each event type for 25 seconds, deduplicates related items, applies guild routes, then creates one grouped notification with map pins and details.