Skip to content

ExecutionLogsChannel

Specialized channel for execution log subscriptions Provides a cleaner API than the generic RealtimeChannel

new ExecutionLogsChannel(url, executionId, type, token, tokenRefreshCallback): ExecutionLogsChannel

ParameterType
urlstring
executionIdstring
typeExecutionType
tokennull | string
tokenRefreshCallbacknull | () => Promise<null | string>

ExecutionLogsChannel

onLog(callback): this

Register a callback for log events

ParameterTypeDescription
callbackExecutionLogCallbackFunction to call when log entries are received

this

This channel for chaining

channel.onLog((log) => {
console.log(`[${log.level}] Line ${log.line_number}: ${log.message}`)
})

subscribe(callback?): this

Subscribe to execution logs

ParameterTypeDescription
callback?(status, err?) => voidOptional status callback

this

Promise that resolves when subscribed

await channel.subscribe()

unsubscribe(): Promise<"error" | "ok" | "timed out">

Unsubscribe from execution logs

Promise<"error" | "ok" | "timed out">

Promise resolving to status

await channel.unsubscribe()