Stream command logs
GET
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/logsStreams the output of a command in real-time using newline-delimited JSON (ND-JSON). Each entry includes the output data and stream type. Stream types include
stdout, stderr, and error (for stream failures).https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/cmd/{cmdId}/logs
const response = await fetch('https://api.vercel.com/v2/sandboxes/sessions/sessionId/cmd/cmdId/logs?teamId=string&slug=string', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
{ "stream": "string", "data": { "code": "sandbox_stream_closed", "message": "Sandbox stream was closed and is not accepting commands." }}AuthorizationbearerToken
Default authentication mechanism