Skip to main content
Base URL: wss://api.streamlogia.com
wss://api.streamlogia.com/v1/projects/{projectId}/logs/stream?token=YOUR_API_KEY The API key is passed as a query parameter because the WebSocket API does not support custom headers in browsers.

Parameters

projectId
string
required
UUID of the project to subscribe to.
token
string
required
Your project API key (eyJ…).

Messages

The server pushes arrays of log entries as JSON text frames:
[
  {
    "id": "log_7f3a1b9c-…",
    "projectId": "YOUR_PROJECT_ID",
    "level": "ERROR",
    "message": "Unhandled exception in /v1/orders",
    "source": "api.handler",
    "ts": "2026-04-07T09:41:03Z",
    "tags": ["prod"],
    "meta": { "orderId": 9921 }
  }
]

Browser

const ws = new WebSocket(
  `wss://api.streamlogia.com/v1/projects/${projectId}/logs/stream?token=${apiKey}`
);

ws.onmessage = (event) => {
  const entries = JSON.parse(event.data);
  entries.forEach((log) => console.log(`[${log.level}] ${log.message}`));
};

Node.js

import WebSocket from "ws";

const ws = new WebSocket(
  `wss://api.streamlogia.com/v1/projects/${projectId}/logs/stream?token=${apiKey}`
);

ws.on("message", (data) => {
  const entries = JSON.parse(data.toString());
  entries.forEach((log) => console.log(log));
});

Reconnection

The stream does not auto-reconnect. Use exponential back-off:
function connect(delay = 1000) {
  const ws = new WebSocket(
    `wss://api.streamlogia.com/v1/projects/${projectId}/logs/stream?token=${apiKey}`
  );

  ws.onclose = () =>
    setTimeout(() => connect(Math.min(delay * 2, 30_000)), delay);

  ws.onmessage = (event) => {
    const entries = JSON.parse(event.data);
    // handle entries
  };
}

connect();