Skip to main content

SyncsnapServer API

Import: import { SyncsnapServer } from "syncsnap";

Constructor

Uses process.env.SYNCSNAP_TOKEN and the default SyncSnap API base URL.

Methods

createJob()

Creates a new job. Returns { id, projectId, status, createdAt, updatedAt }.

getJob(jobId)

Returns the current job for the given ID.

getUploadUrl(jobId, options)

Returns a presigned upload URL for the job.

getDownloadUrl(jobId, options?)

Returns a presigned download URL for a completed job.

waitForJobCompletion(jobId, options?)

Polls until status is completed or failed, or until timeout/abort. WaitForJobOptions: See SyncsnapServer for usage.