Skip to main content
Read the Notte skill and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.
Source: node-sdk/src/files.ts Download a file to <localDir>/<filename> and return the local path. The file is written atomically (temporary file + rename). Rejects with FileExistsError when the destination exists unless force is set.

Parameters

string
required
ID of the file to download.
string
Destination directory, created if needed. Defaults to the current directory.Default:
FileDownloadOptions
Set force to overwrite an existing destination; defaults to false.Default:

Returns

The local file path after the download has been written successfully.

Raises

  • NotteAPIError if the storage API request fails.
  • InvalidRequestError if storage has not been bound to a session.
  • FileExistsError if the destination exists and force is false. Filesystem errors also propagate.

Example