npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@idioteque/vercel-queue

v0.1.1

Published

Vercel Queue adapter for idioteque worker library

Readme

@idioteque/vercel-queue

Vercel Queue dispatcher implementation for idioteque workers. Provides reliable message queuing using Vercel's managed queue service.

Features

  • 🏗️ Managed infrastructure - No need to manage queue infrastructure
  • 📈 Automatic scaling - Scales with your Vercel deployments
  • 📊 Built-in monitoring - Queue metrics available in Vercel dashboard
  • 🔌 Simple integration - Works seamlessly with Next.js applications
  • Reliable delivery - Messages are guaranteed to be processed
  • 🎯 Namespace support - Organize queues with custom namespaces

Installation

npm install @idioteque/vercel-queue

Usage

import { createVercelQueueDispatcher } from '@idioteque/vercel-queue';
import { createWorker } from 'idioteque';

const dispatcher = createVercelQueueDispatcher({
  namespace: 'my-app'
});

const worker = createWorker({
  dispatcher,
  // ... other options
});

// Mount the worker to handle queue messages
export const { POST } = dispatcher.mount(worker, {
  functions: [yourFunction],
});

API

createVercelQueueDispatcher(options)

Creates a Vercel Queue-based dispatcher for reliable message queuing.

Parameters:

  • options.namespace: string - Unique namespace for your queue messages

Returns: WorkerDispatcher & { mount: Function }

Methods

dispatch(data)

Sends a message to the Vercel Queue for processing.

Parameters:

  • data: string - Serialized event data

Returns: Promise<void>

mount(worker, options)

Creates a Vercel Queue callback handler for processing messages.

Parameters:

  • worker: Worker<T> - The idioteque worker instance
  • options: WorkerMountOptions - Worker mounting configuration

Returns: { POST: ReturnType<typeof handleCallback> }

Configuration

Vercel Queue Setup

  1. Install the Vercel Queue integration on your Vercel project
  2. Configure your queue handlers in your API routes
  3. Add queue configuration to your vercel.json
  4. Deploy your application

vercel.json Configuration

You need to configure your queue triggers in vercel.json:

{
  "functions": {
    "app/api/worker/route.ts": {
      "experimentalTriggers": [
        {
          "type": "queue/v1beta",
          "topic": "idioteque-message-your-namespace",
          "consumer": "worker",
          "retryAfterSeconds": 300
        }
      ]
    }
  }
}

Important: The topic must match the pattern idioteque-message-{namespace} where {namespace} is the namespace you specified when creating the dispatcher.

For example, if you create a dispatcher with:

const dispatcher = createVercelQueueDispatcher({
  namespace: 'ecommerce'
});

Your vercel.json should have:

{
  "functions": {
    "app/api/worker/route.ts": {
      "experimentalTriggers": [
        {
          "type": "queue/v1beta",
          "topic": "idioteque-message-ecommerce",
          "consumer": "worker",
          "retryAfterSeconds": 300
        }
      ]
    }
  }
}

Environment Variables

Vercel Queue automatically configures the necessary environment variables when deployed to Vercel.

Examples

Basic Setup

import { createVercelQueueDispatcher } from '@idioteque/vercel-queue';
import { createWorker } from 'idioteque';

const dispatcher = createVercelQueueDispatcher({
  namespace: 'user-processing'
});

const worker = createWorker({
  eventsSchema: EventSchema,
  store: redisStore,
  dispatcher,
});

API Route

// app/api/worker/route.ts
import { dispatcher, worker } from '@/lib/worker';
import { processUserSignup, sendEmail } from '@/functions';

export const { POST } = dispatcher.mount(worker, {
  functions: [processUserSignup, sendEmail],
});

Multiple Namespaces

// User processing queue
const userDispatcher = createVercelQueueDispatcher({
  namespace: 'user-events'
});

// Email processing queue
const emailDispatcher = createVercelQueueDispatcher({
  namespace: 'email-events'
});

const userWorker = createWorker({
  dispatcher: userDispatcher,
  // ... other options
});

const emailWorker = createWorker({
  dispatcher: emailDispatcher,
  // ... other options
});

Queue Message Structure

Messages are automatically formatted with the following structure:

{
  data: string // Your serialized event data
}

The queue name follows the pattern: idioteque-message-${namespace}

Deployment

When deploying to Vercel:

  1. Ensure you have the Vercel Queue integration installed
  2. Your API routes will automatically be configured as queue handlers
  3. Messages will be processed according to your queue configuration

Development

For local development, Vercel Queue will work in development mode when using vercel dev.

License

MIT