Skip to main content

Overview

Every DeviceClient instance includes a cdn property for uploading files such as screenshots, logs, and sensor data exports. The CDN uses the same credential as the device connection. A new device credential must include the assets.upload operation before this client can upload files.

Methods

upload

Upload a file to the CDN. Returns a CdnUploadResult with the file ID and public URL.
Buffer | Blob
required
File content as a Node.js Buffer or Blob.
string
required
Filename including extension (e.g., screenshot.png, sensor-log.csv).
string
MIME type (e.g., image/png, text/csv). Defaults to application/octet-stream.
Returns: CdnUploadResult

download

Download a file from the CDN by its file ID.
string
required
The file ID returned from a previous upload.
Returns: Buffer containing the file content.

getUrl

Get the public URL for a file without downloading it.
string
required
The file ID returned from a previous upload.
Returns: string — the full CDN URL.

Use Cases

Screenshots

Kiosk devices capturing screen state for debugging or audit.

Sensor Logs

Periodic CSV or JSON exports of accumulated sensor readings.

Photos

Camera-equipped devices uploading inspection photos.

Firmware Reports

Diagnostic reports uploaded for agent analysis.

Example: Screenshot Upload

A kiosk device that takes a screenshot when the agent requests it and uploads it to the CDN:

Next Steps

Node.js Client

Full client reference including CDN property

Retail Kiosk Example

Complete kiosk example with CDN uploads

API Reference

CDN class method signatures