SDK ReferenceTypeScript SDK
RemoteFile
SDK version
0.31.0. Install withnpm install @composio/core@0.31.0.
Properties
| Name | Type | Description |
|---|---|---|
downloadUrl | string | Presigned URL for downloading the file |
expiresAt | string | ISO 8601 timestamp when the download URL expires |
mountRelativePath | string | Relative path within the mount (e.g. "report.pdf") |
sandboxMountPrefix | string | Absolute 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
| Name | Type | Description |
|---|---|---|
path? | string | Local path to save the file. An explicit path does not require a home directory. If omitted, saves to the Composio temp directory using the filename from the mount path. An existing default destination gets a copy number before its extension. |
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): RemoteFileParameters
| Name | Type | Description |
|---|---|---|
data | unknown | Raw API response with snake_case keys |
Returns
RemoteFile — A RemoteFile instance