SDK ReferenceTypeScript SDK

RemoteFile

Markdown

Usage

Access this class through the composio.remoteFile property:

const composio = new Composio({ apiKey: 'your-api-key' });
const result = await composio.remoteFile.list();

Properties

NameTypeDescription
downloadUrlstringPresigned URL for downloading the file
expiresAtstringISO 8601 timestamp when the download URL expires
mountRelativePathstringRelative path within the mount (e.g. "report.pdf")
sandboxMountPrefixstringAbsolute mount path inside the sandbox (e.g. /mnt/files)

Methods

blob()

Fetches the file content as a Blob.

async blob(): Promise<Blob>

Returns

Promise<Blob> — The file content as a Blob


buffer()

Fetches the file content as a buffer.

async buffer(): Promise<Uint8Array>

Returns

Promise<Uint8Array> — The file content as a Uint8Array


save()

Downloads and saves the file to the local filesystem. Requires a Node.js runtime with file system support (not available in Cloudflare Workers/Edge).

async save(path?: string): Promise<string>

Parameters

NameTypeDescription
path?stringLocal path to save the file. If omitted, saves to the Composio temp directory using the filename from the mount path.

Returns

Promise<string> — The absolute path where the file was saved


text()

Fetches the file content as UTF-8 text.

async text(): Promise<string>

Returns

Promise<string> — The file content as a string


parse()

Parses an API response (snake_case) and returns a RemoteFile instance.

parse(data: unknown): RemoteFile

Parameters

NameTypeDescription
dataunknownRaw API response with snake_case keys

Returns

RemoteFile — A RemoteFile instance