zerodb-qstash
v1.0.0
Published
Drop-in Upstash QStash replacement backed by ZeroDB event stream. Publish messages, schedule recurring tasks — zero config, auto-provisions on first use.
Downloads
192
Maintainers
Readme
zerodb-qstash
Drop-in Upstash QStash replacement backed by ZeroDB event stream. Zero config — auto-provisions on first use.
Why?
QStash is great for serverless messaging, but it's a separate service with its own billing. zerodb-qstash gives you the same Client API backed by ZeroDB's managed event stream. No signup, no separate account — just npm install and go.
Install
npm install zerodb-qstashQuick Start
import { Client } from 'zerodb-qstash';
const qstash = new Client({ token: process.env.ZERODB_API_KEY });
// Publish a message
await qstash.publish({
topic: 'user-signups',
body: { userId: '123', email: '[email protected]' },
});
// Publish JSON (convenience)
await qstash.publishJSON({
topic: 'notifications',
body: { type: 'welcome', userId: '123' },
});
// Schedule recurring
await qstash.publish({
topic: 'daily-report',
body: 'generate',
cron: '0 9 * * *',
});That's it. On first use, a free ZeroDB project is auto-provisioned. You'll see a claim URL in the console to keep it permanently.
QStash Migration Guide
Replace @upstash/qstash with zerodb-qstash:
- import { Client } from '@upstash/qstash';
+ import { Client } from 'zerodb-qstash';
- const qstash = new Client({ token: process.env.QSTASH_TOKEN });
+ const qstash = new Client({ token: process.env.ZERODB_API_KEY });
// QSTASH_TOKEN also works for zero-change migration
// publish() works the same way
await qstash.publish({
topic: 'emails',
body: JSON.stringify({ to: '[email protected]' }),
});
// publishJSON() works the same way
await qstash.publishJSON({
topic: 'emails',
body: { to: '[email protected]', subject: 'Welcome' },
});What's different?
| Feature | QStash | zerodb-qstash |
|---------|--------|--------------|
| Setup | Upstash account + billing | Zero config, auto-provisions |
| Auth | QSTASH_TOKEN | ZERODB_API_KEY (or QSTASH_TOKEN) |
| publish() | HTTP delivery | Event stream + hooks |
| publishJSON() | Same | Same |
| Topics | Topic management | Same API |
| Schedules | Cron schedules | Same API |
| Messages | Message query | Same API |
| Dependencies | Several | Zero (native fetch) |
Topics
// Create a topic
await qstash.topics.create('notifications', ['https://app.com/hook']);
// List topics
const topics = await qstash.topics.list();
// Get a topic
const topic = await qstash.topics.get('notifications');
// Remove a topic
await qstash.topics.remove('old-topic');Schedules
// Create a schedule
const schedule = await qstash.schedules.create({
topic: 'cleanup',
body: 'run',
cron: '0 0 * * *', // daily at midnight
});
// List schedules
const schedules = await qstash.schedules.list();
// Pause / resume
await qstash.schedules.pause(schedule.scheduleId);
await qstash.schedules.resume(schedule.scheduleId);
// Delete
await qstash.schedules.delete(schedule.scheduleId);Messages
// List messages
const messages = await qstash.messages.list({ topic: 'signups', limit: 50 });
// Get a message
const msg = await qstash.messages.get('msg_123');Configuration
const qstash = new Client({
token: 'your-zerodb-api-key', // or env ZERODB_API_KEY / QSTASH_TOKEN
projectId: 'your-project-id', // or env ZERODB_PROJECT_ID
baseUrl: 'https://api.ainative.studio', // default
silent: false, // suppress console output
});CommonJS
const { Client } = require('zerodb-qstash');
const qstash = new Client();ZeroDB is an AI-native database with vectors, NoSQL, files, events, and Postgres — all auto-provisioned.
