Skip to content
JS Client 11.3: stream logs in real time

JS Client 11.3: stream logs in real time

November 14, 2025·David Legrand
David Legrand

Clever Cloud JS client 11.3 is available. The new client structure introduced in 11.1 now supports Server-Sent Events (SSE): client.stream() opens a real-time stream from a stream command, reconnects automatically when the connection drops and resumes from the last event received.

This release uses it to stream logs. StreamApplicationRuntimeLogCommand and StreamAddonRuntimeLogCommand deliver the runtime logs of an application or an add-on, StreamApplicationAccessLogCommand the access logs of an application. They accept a time range (since, until), a limit, and for runtime logs a deployment, instances or a text filter to narrow the output:

import { CcApiClient } from '@clevercloud/client/cc-api-client.js';
import { StreamApplicationRuntimeLogCommand } from '@clevercloud/client/cc-api-commands/log/stream-application-runtime-log-command.js';

const client = new CcApiClient({
  authMethod: {
    type: 'api-token',
    apiToken: process.env.CLEVER_API_TOKEN,
  },
});

const stream = await client.stream(
  new StreamApplicationRuntimeLogCommand({ applicationId: 'app_xxxxxxxx', filter: 'error' }),
);
stream.onLog((log) => console.log(log.message));
await stream.start();

Release 11.2.1 also fixes the resume position of a stream, which an event without an ID could reset. To upgrade, run:

npm install @clevercloud/client@11.3.0
Last updated on