LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithsandboxSandboxgenerateDownloadURL
Method●Since v0.11

generateDownloadURL

Create a link that downloads one file from this sandbox.

The link carries its own token, so anyone holding the URL can fetch that one file without a LangSmith credential. Fetching wakes a stopped sandbox.

Do not modify the file after minting a link for it. The link is pinned to a path, not to a snapshot of the contents, so a later write to that path may or may not be reflected in what the link serves. Write a new file and mint a new link when the contents change.

Copy
generateDownloadURL(path: string, options: GenerateDownloadURLOptions = {}): Promise<DownloadURL>

Parameters

NameTypeDescription
path*string

File path inside the sandbox.

optionsGenerateDownloadURLOptions
Default:{}

Expiry and response header overrides.

Example

Copy
const link = await sandbox.generateDownloadURL("/tmp/report.pdf", {
  expiresInSeconds: 3600,
});
console.log(link.download_url);
View source on GitHub