Vercel Queue
Configure Vercel Queue and send named jobs through Vercel.
Vercel Queue fits apps that already deploy on Vercel and want provider-native queue topics and callbacks. ViteHub maps the queue file name to the Vercel topic name and keeps the same runQueue() API for sending messages.
Install the SDK
Terminal
pnpm add https://pkg.pr.new/nuxt-hub/agent/@vitehub/queue@main @vercel/queue
Configure Vercel
nuxt.config.ts
export default defineNuxtConfig({
modules: ['@vitehub/queue/nuxt'],
})
Vercel hosting picks the queue provider automatically. For server/queues/welcome-email.ts, ViteHub sends to the Vercel topic welcome-email.
During Vercel builds, ViteHub also patches the generated function config so each discovered queue registers a queue/v2beta consumer trigger automatically.
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
| Concern | Behavior |
|---|---|
| Topic naming | The discovered queue name becomes the Vercel topic name. |
| Consumer triggers | ViteHub emits one Vercel queue trigger per discovered queue and uses consumer or "default" for the trigger consumer name. |
| Callback helpers | The provider handle exposes callback(), nodeCallback(), and createPollingClient(...). |
| Local options | Put 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.