Environments
Rinda environments provide isolated contexts for your queues and storage, ensuring safe separation between development, staging, and production.
Default Environments
Every project comes with three environments:
| Environment | API Key Prefix | Purpose |
|---|---|---|
| Development | rk_dev_... | Local development and testing |
| Staging | rk_stg_... | Pre-production validation |
| Production | rk_prod_... | Live traffic |
How Isolation Works
- Each environment has its own set of queues and storage objects
- API keys are scoped to a single environment
- A production API key cannot access staging or development queues
- Queue names can be reused across environments (e.g.,
order-eventsin both dev and prod)
Using Environments
Your code doesn't need to know which environment it's running in — the API key determines the environment:
import { Rinda } from '@rindahq/sdk';
// In development: uses dev queues
// In production: uses prod queues
// Determined entirely by the API key
const rinda = new Rinda({
apiKey: process.env.RINDA_API_KEY,
});
Environment Variables Setup
# .env.development
RINDA_API_KEY=rk_dev_abc123
# .env.staging
RINDA_API_KEY=rk_stg_def456
# .env.production
RINDA_API_KEY=rk_prod_ghi789
Best Practices
- Never use production keys locally — always use development keys for local work
- Use separate API keys per service — easier to rotate and audit
- Match infrastructure — keep queue configurations similar across environments
- Test in staging first — validate changes before deploying to production