Read a file
POST
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/fs/readDownloads the contents of a file from a session's filesystem. The file content is returned as a binary stream with appropriate Content-Disposition headers for file download.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.sandboxes.readSessionFile({ sessionId: "sbx_abc123", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", requestBody: { cwd: "/home/vercel-sandbox", path: "dist/agent-output.md", }, });
console.log(result);}
run();Response
"string"AuthorizationbearerToken
Default authentication mechanism