Vercel Queue

Configure Vercel Queue and send named jobs through Vercel.

Use Vercel Queue when queue publishing and consumption should stay inside the Vercel deployment model.

Install the SDK

Terminal
pnpm add https://pkg.pr.new/vite-hub/vitehub/@vitehub/queue@main @vercel/queue

Configure Vercel

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@vitehub/queue/nuxt'],
})

On Vercel hosting, ViteHub uses the Vercel queue provider automatically. For server/queues/welcome-email.ts, ViteHub sends to the Vercel topic welcome-email.

During Vercel builds, ViteHub generates hidden queue consumer functions inside .vercel/output/functions/* and adds the queue/v2beta trigger metadata there automatically. No queue-specific vercel.json or generated api/* source files are required.

Define a queue

server/queues/welcome-email.ts
import { defineQueue } from '@vitehub/queue'

export default defineQueue(async (job) => {
  return {
    email: job.payload?.email,
  }
}, {
  callbackOptions: {
    visibilityTimeoutSeconds: 30,
  },
  consumer: 'welcome-email-consumer',
})

What changes on Vercel

ConcernBehavior
Topic namingThe discovered queue name becomes the Vercel topic name.
Consumer triggersViteHub emits one hidden Vercel queue consumer per discovered queue in build output and attaches the queue/v2beta trigger automatically.
Callback helpersThe provider handle exposes callback(), nodeCallback(), and createPollingClient(...).
Local optionsPut callbackOptions and consumer directly inside defineQueue(..., options).
Choose Vercel when you want queue publishing and consumption to stay in the same Vercel deployment model as the rest of the app.