@flamedeck/upload NPM package. This library offers a convenient function to send trace data directly to the Flamedeck API.
Installation
You can install the package using npm or yarn:Basic Usage
The core of the library is theuploadTraceToApi function. You’ll need to import it along with the necessary types.
Prerequisites
Example (Node.js)
Here’s a TypeScript example demonstrating how to upload a trace file from a Node.js environment:Example (Browser)
When using in a browser environment (e.g., from a file input):UploadOptions Interface
TheuploadTraceToApi function accepts an options object conforming to the UploadOptions interface:
string
required
Your Flamedeck API key.
Blob | ArrayBuffer
required
The content of the trace file. Use File/Blob for browser, ArrayBuffer for Node.js.
string
required
The original filename.
string
required
A descriptive name for the trace.
string
The Git commit SHA associated with this trace.
string
The Git branch name associated with this trace.
string
Free-form text notes to attach to the trace.
string
The UUID of an existing folder to upload the trace into.
boolean
default:"false"
Set to
true to make the trace publicly accessible. Defaults to false (private).Record<string, unknown> | string
Custom key-value metadata to associate with the trace.
string
Override the default Supabase functions base URL (for self-hosted or testing).
For detailed descriptions of optional fields like
commitSha, branch, notes, folderId, and metadata, please refer to the CLI Upload documentation, as they serve the same purpose.Error Handling
TheuploadTraceToApi function will throw an UploadError if the upload fails. This custom error object contains:
status: HTTP status code (if applicable)message: Error messagedetails: Additional error information from the API

