Skip to main content

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:

EnvironmentAPI Key PrefixPurpose
Developmentrk_dev_...Local development and testing
Stagingrk_stg_...Pre-production validation
Productionrk_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-events in 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​

  1. Never use production keys locally — always use development keys for local work
  2. Use separate API keys per service — easier to rotate and audit
  3. Match infrastructure — keep queue configurations similar across environments
  4. Test in staging first — validate changes before deploying to production