
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@buggyhunter/qjobs
Advanced tools
A simple, type-safe job queue SDK for serverless environments (Next.js, Vercel, Node.js) powered by Upstash QStash.
A simple, type-safe job queue SDK for serverless environments (Next.js, Vercel, Node.js) powered by Upstash QStash.
npm install @upstash/qjobs
Set up a catch-all route to receive and process jobs. You only need to do this once per project.
Create pages/api/jobs/[jobs].ts
:
import { jobRouter } from '@upstash/qjobs';
export default jobRouter();
Create app/api/jobs/[jobs]/route.ts
:
import { jobRouter } from '@upstash/qjobs';
export const POST = jobRouter();
Define your job(s) with type-safe payloads and handler logic.
import { createJob } from '@upstash/qjobs';
const emailJob = createJob('sendEmail', async (payload: { to: string; subject: string; body: string }) => {
// Your email sending logic here
console.log('Sending email to', payload.to);
});
Enqueue jobs to be processed by your handler, either immediately or with delay/schedule.
// Enqueue a job to run immediately
await emailJob.enqueue({ to: 'user@example.com', subject: 'Hello', body: 'Welcome!' });
// Enqueue a job with a delay or schedule
await emailJob.enqueue(
{ to: 'user@example.com', subject: 'Scheduled', body: 'This will be sent later.' },
{ delay: '10s' } // or { schedule: '0 9 * * *' } for cron
);
QSTASH_TOKEN
: Your Upstash QStash token (required for enqueueing jobs)QSTASH_SIGNING_KEY
: Your Upstash QStash signing key (required for signature verification)VERCEL_URL
or VERCEL_PROJECT_PRODUCTION_URL
: (optional, for automatic URL inference)This SDK automatically verifies the authenticity of incoming job requests using Upstash QStash's signature verification (via @upstash/qstash
).
QSTASH_SIGNING_KEY
in your environment for secure operation.MIT
FAQs
A simple, type-safe job queue SDK for serverless environments (Next.js, Vercel, Node.js) powered by Upstash QStash.
We found that @buggyhunter/qjobs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.