Skip to content
Seamlift

HTTP worker and webhooks

Queue jobs, poll results, cancel work and verify signed callbacks.

Run a worker

GET /health is public; every other route requires a Bearer secret. Queue and history are in memory. Use the library behind a durable queue if jobs must survive restarts.

TypeScript
import { createServer } from "seamtranscode/server";
import { local } from "seamtranscode";
const worker = createServer({ storage: local({ root: "./media" }), secret: process.env.SEAMTRANSCODE_SECRET! });
await worker.listen(8100);

Queue and control jobs

POST /transcode or /previews returns 202 and a job id. GET /jobs/:id returns progress and results; DELETE /jobs/:id cancels a job. Input and output are storage keys. Metadata is echoed in every callback.

Bash
curl -X POST http://localhost:8100/transcode -H "Authorization: Bearer $SEAMTRANSCODE_SECRET" -H "Content-Type: application/json" -d '{"input":"uploads/film.mp4","output":"videos/film","metadata":{"videoId":"film"}}'

Verify callbacks

Webhooks carry HMAC signatures and timestamps. Pass the original bytes and seamtranscode-signature header to verifyWebhook. Progress, previews, renditions, completion and failure events share the same job id. Final events retry with backoff.

TypeScript
import { verifyWebhook } from "seamtranscode/webhooks";
const event = await verifyWebhook(rawBody, signatureHeader, webhookSecret);

Source and complete examples on GitHub