Appearance
Function: captureBrowserLogs()
ts
function captureBrowserLogs(ctx: Context): void;Defined in: src/logger/attachBrowserLogger.ts:79
Capture browser console messages and uncaught errors from a Context, routing them through log.browser.*.
Safe to call multiple times on the same context — duplicate listeners are prevented automatically.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | Context | The skill Context. |
Returns
void
Example
ts
import { captureBrowserLogs } from '@matterway/sdk';
export async function start(ctx: Context) {
captureBrowserLogs(ctx);
// browser console.log / errors now flow through log.browser.*
}