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
- Node.js SDK
- REST API
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);
curl -X POST https://api.rinda.dev/v1/queues \
-H "Authorization: Bearer rk_prod_your_api_key" \
-H "Content-Type: application/json" \
-d '{"name": "order-events", "region": "us-east-1"}'
3. Send a Message
- Node.js SDK
- REST API
const q = rinda.queue(queue.id);
const { messageId } = await q.send({
body: { orderId: '123', status: 'confirmed' },
});
console.log('Message sent:', messageId);
curl -X POST https://api.rinda.dev/v1/queues/QUEUE_ID/messages \
-H "Authorization: Bearer rk_prod_your_api_key" \
-H "Content-Type: application/json" \
-d '{"body": {"orderId": "123", "status": "confirmed"}}'
4. Receive Messages
- Node.js SDK
- REST API
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
}
# Receive messages (long-poll for 20 seconds)
curl "https://api.rinda.dev/v1/queues/QUEUE_ID/messages?maxMessages=10&waitTimeSeconds=20" \
-H "Authorization: Bearer rk_prod_your_api_key"
# Delete (acknowledge) a message
curl -X DELETE "https://api.rinda.dev/v1/queues/QUEUE_ID/messages/MESSAGE_ID" \
-H "Authorization: Bearer rk_prod_your_api_key"
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
- Authentication — Learn about API keys and scoping
- Core Concepts — Understand projects, environments, and queues
- Queues Guide — Deep dive into queue configuration
- FIFO Queues — Strict ordering and exactly-once delivery
- Message Storage — large message bodies, and the archive of what you sent
- API Reference — Full API documentation with code examples