Offload long-running tasks, process job queues, and scale your application's backend effortlessly with a single API. Turn complex background processes into simple, manageable Services-as-Software.
import { Dô } from '@do/sdk';
// Initialize the .do client with your API key
const dô = new Dô(process.env.DO_API_KEY);
// Enqueue a new job to be processed by a worker
async function queueVideoProcessing(videoId: string) {
const job = await dô.worker.enqueue({
task: 'process-video',
payload: {
id: videoId,
format: '1080p',
watermark: true
}
});
console.log(`Job ${job.id} enqueued successfully!`);
return job.id;
}