For frontend developers
Close the modal. Keep the export running.
When the backend team is booked, you can still ship the export button. Queue the job from a server route in your frontend project and let the user get back to work.
500 requests per month on the free plan.
const job = await fetch(
"https://api.zeplo.io/queues/enqueue",
{
method: "POST",
headers: {
Authorization: "Bearer " + process.env.ZEPLO_TOKEN,
"Content-Type": "application/json"
},
body: JSON.stringify({
url: "https://example.com/jobs/export",
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ exportId })
})
}
)
if (!job.ok) throw new Error("Could not queue export")
const { requestId } = await job.json()
From button click to finished export
Queue it from your app
Have the button call a server action that checks the user’s access and creates an export record. Use that record’s ID as exportId and keep the Zeplo token in the server environment.
Show the queued state
Once Zeplo accepts the request, show “Export queued.” The user can close the modal while Zeplo delivers the job to your export endpoint.
Make the file available
Your endpoint builds the file and updates the export record with its download URL. If delivery fails, use the Zeplo request ID to inspect the response.
Try it with your endpoint.
Create a workspace, grab your API token, and send your first job.