Server SDK installation
Thesyncsnap package is the server-side SDK for SyncSnap. It talks to the SyncSnap API to create jobs, fetch job status, and get presigned upload/download URLs. Your backend uses it so the React SDK can work without ever touching the API key.
Install
Environment
Set your SyncSnap API key so the SDK can authenticate. Get your key from the SyncSnap dashboard:.env or .env.local (and never expose this in the client). The SyncsnapServer constructor reads process.env.SYNCSNAP_TOKEN.
What the server does
- Create job — Your route calls
client.createJob()and returns the job to the frontend. - Get job — Your route receives a job ID, calls
client.getJob(id), and returns the job. - Wait for completion — Your route (e.g.
/job/:id/wait) runsclient.waitForJobCompletion(id)until the job completes or fails, then returns the job and an optional result (e.g. from youronCompletedcallback). - Get download URL — For a completed job, your route calls
client.getDownloadUrl(id)and returns the presigned URL to the frontend.
Next steps
- SyncsnapServer — API and configuration.
- Next.js route handler — Single catch-all route for Next.js App Router.