useSyncsnapJob
useSyncsnapJob creates a transfer job, then calls your backend’s wait endpoint. The server polls until the job completes or fails and returns the final job plus a result (e.g. presigned download URL or a custom payload from your server’s onCompleted callback). The hook passes that result to your onCompleted(job, result). It powers SyncsnapUploadButton and can be used on its own for custom UIs.
Basic usage
- Call start() to create a job and call the wait endpoint (server does the polling).
- jobId is set once the job is created; use it with SyncsnapQrCode or createUploadUrl.
- status is the current job status; isWaiting is true while the wait request is in flight.
- onCompleted(job, result) runs when the job finishes; result is what your server’s
onCompletedreturned, or the presigned download URL when no callback is set.
Options
Return value
Custom URLs
Use a different API base path:Wait timeout and interval
The client sendstimeoutMs and intervalMs as query params to the wait endpoint. Override the defaults: