Quickstart
Goal: create a project, enqueue a job, claim it with a worker key, and mark it complete. You need the dashboard and API reachable (local Compose or staging).
1. Sign up and create a project
- Open Sign up and create an account
- Create an organization and a project in the console
- Copy your Project ID (you will set
JOBORC_PROJECT_ID)
2. Create API keys
In the project, create two keys when possible: one for enqueue and one with worker scopes for claim / heartbeat / complete. Store them in env vars — never in the browser.
3. Install the SDK
>_example.bash
BASH
pnpm add @joborc/sdk4. Enqueue a job
>_example.ts
TS
import { createJobOrc } from '@joborc/sdk';const joborc = createJobOrc({ apiKey: process.env.JOBORC_API_KEY!, projectId: process.env.JOBORC_PROJECT_ID!, baseUrl: process.env.JOBORC_BASE_URL, // e.g. https://api.example.com});const job = await joborc.jobs.enqueue( 'email.send', { to: 'you@example.com', subject: 'Hello' }, { queue: 'default', idempotencyKey: 'hello-1' },);console.log(job.id, job.status);5. Run a worker
>_example.ts
TS
import { createJobOrc } from '@joborc/sdk';const joborc = createJobOrc({ apiKey: process.env.JOBORC_WORKER_KEY!, projectId: process.env.JOBORC_PROJECT_ID!, baseUrl: process.env.JOBORC_BASE_URL,});const worker = joborc.worker({ queues: ['default'], concurrency: 2, handlers: { 'email.send': async (payload, ctx) => { console.log('job', ctx.jobId, payload); }, },});await worker.start();6. Verify in the console
Open the project Jobs view. You should see enqueue → running → succeeded (or retrying on failure). Timeline events explain each transition.