Skip to main content

Quickstart

Get up and running with Rinda in under 5 minutes. By the end of this guide you'll have created a queue, sent a message, and received it.

Prerequisites​

  • A Rinda account (free tier available)
  • An API key (create one in Settings > API Keys)

1. Install the SDK​

npm install @rindahq/sdk
Looking for another language?

We currently offer an official SDK for Node.js/TypeScript. For Python, PHP, C#, Go, and other languages, use the REST API directly with any HTTP client — it works with any language that can make HTTP requests.

2. Create a Queue​

import { Rinda } from '@rindahq/sdk';

const rinda = new Rinda({
apiKey: 'rk_prod_your_api_key',
});

const queue = await rinda.queues.create({
name: 'order-events',
region: 'us-east-1',
});

console.log('Queue created:', queue.id);

3. Send a Message​

const q = rinda.queue(queue.id);

const { messageId } = await q.send({
body: { orderId: '123', status: 'confirmed' },
});

console.log('Message sent:', messageId);

4. Receive Messages​

const messages = await q.receive({
maxMessages: 10,
waitTimeSeconds: 20, // Long-polling
});

for (const msg of messages) {
console.log('Received:', msg.body);
await msg.delete(); // Acknowledge the message
}

5. Use Workers (SDK)​

The SDK includes a QueueWorker that automatically polls for messages with retry logic and graceful shutdown:

import { Rinda } from '@rindahq/sdk';

const rinda = new Rinda({ apiKey: 'rk_prod_your_api_key' });
const q = rinda.queue('QUEUE_ID');

const worker = q.createWorker({
handler: async (message) => {
console.log('Processing:', message.body);
// Your processing logic here
return message; // Acknowledge — message is auto-deleted
},
batchSize: 5,
waitTimeSeconds: 20,
});

worker.start();

// Graceful shutdown
process.on('SIGTERM', () => worker.stop());

Next Steps​