Skip to content
Get started

Stream build events (SSE)

client.builds.events(stringid, BuildEventsParams { follow } query?, RequestOptionsoptions?): BuildEvent { timestamp, type, content, status } | Stream<BuildEvent { timestamp, type, content, status } >
get/builds/{id}/events

Streams build events as Server-Sent Events. Events include:

  • log: Build log lines with timestamp and content
  • status: Build status changes (queued→building→pushing→ready/failed)
  • heartbeat: Keep-alive events sent every 30s to prevent connection timeouts

Returns existing logs as events, then continues streaming if follow=true.

ParametersExpand Collapse
id: string
query: BuildEventsParams { follow }
follow?: boolean

Continue streaming new events after initial output

ReturnsExpand Collapse
BuildEvent { timestamp, type, content, status }
timestamp: string

Event timestamp

formatdate-time
type: "log" | "status" | "heartbeat"

Event type

Accepts one of the following:
"log"
"status"
"heartbeat"
content?: string

Log line content (only for type=log)

status?: BuildStatus

New build status (only for type=status)

Accepts one of the following:
"queued"
"building"
"pushing"
"ready"
"failed"
"cancelled"
Stream build events (SSE)
import Hypeman from '@onkernel/hypeman';

const client = new Hypeman({
  apiKey: 'My API Key',
});

const buildEvent = await client.builds.events('id');

console.log(buildEvent.timestamp);
Returns Examples