Skip to main content

React SDK installation

The @syncsnap/react package provides React components and hooks for SyncSnap: upload button, QR code, and job polling.

Install

npm install @syncsnap/react

Peer dependencies

  • React ^18.0.0
  • Tailwind CSS ^3.0.0 or ^4.0.0 (for component styles)
Install them if your project doesn’t already have them:
npm install react tailwindcss

Backend requirement

The React SDK talks to your backend, not directly to SyncSnap. You must expose:
  • POST /api/syncsnap/job — create job
  • GET /api/syncsnap/job/:id — get job
  • GET /api/syncsnap/job/:id/wait — server waits until job completes; returns { job, result? }
  • GET /api/syncsnap/job/:id/download — get presigned download URL (optional)
Use the Server SDK (e.g. with Next.js route handler) to implement these.

Styling

Components use Tailwind and the SDK theme. Add to your global CSS:
@import "tailwindcss";
@import "@syncsnap/react/theme";
See Styling for Tailwind v3, shadcn, or custom setup.

What’s included

ExportPurpose
SyncsnapUploadButtonButton + dialog with QR code; uses useSyncsnapJob internally
SyncsnapQrCodeQR code only (for custom UI)
useSyncsnapJobHook to create job, poll status, and get download URL
createUploadUrlBuild the URL to encode in the QR code
Next: SyncsnapUploadButton or useSyncsnapJob.