SyncsnapUploadButton
SyncsnapUploadButton is an all-in-one component: a button that opens a dialog with a QR code. When the user clicks the button, a job is created and the QR code is shown; the hook then calls your backend’s wait endpoint (the server polls until the job completes or fails). When done, your onCompleted(job, result) runs with the server’s result.
Basic usage
onCompleted(job, result) receives it (e.g. a custom payload from your server’s onCompleted callback or the presigned download URL).
Props
All useSyncsnapJob options are supported (e.g.createJobUrl, getJobUrl, getWaitForCompletionUrl, waitTimeoutMs, waitIntervalMs, onCompleted). In addition:
| Prop | Type | Default | Description |
|---|---|---|---|
buttonText | string | "Start upload" | Label of the trigger button. |
className | string | — | Applied to the wrapper div. |
qrSize | number | 240 | QR code size in pixels. |
qrBaseUrl | string | — | Base URL for the upload page (see createUploadUrl). Overrides default https://upload.syncsnap.xyz/. |
errorCorrectionLevel | "L" | "M" | "Q" | "H" | "M" | QR code error correction level. |
Callbacks
Pass the same callbacks as useSyncsnapJob:Custom API paths
If your API is not under/api/syncsnap/job: