Skip to main content

Multi-Environment Support

Valmi Value supports multiple environments for development, staging, and production.

Environment Types

Development

  • Purpose: Local development and testing
  • Data: Test data only
  • Keys: Development API keys
  • Isolation: Separate from production

Staging

  • Purpose: Pre-production testing
  • Data: Production-like test data
  • Keys: Staging API keys
  • Isolation: Separate from production

Production

  • Purpose: Live customer-facing environment
  • Data: Real customer data
  • Keys: Production API keys
  • Isolation: Fully isolated

Environment Configuration

Separate Accounts

Use separate Valmi Value accounts for each environment:
  • Development Account: For development
  • Staging Account: For staging
  • Production Account: For production

Separate API Keys

Use different API keys per environment:
import os

# Get key from environment variable
api_key = os.getenv("VALMI_API_KEY")

# Development: VALMI_API_KEY=sk_test_dev_abc123
# Staging: VALMI_API_KEY=sk_test_staging_xyz789
# Production: VALMI_API_KEY=sk_live_prod_def456

value = ValueClient(api_key=api_key)

Separate Agent Keys

Use different agent keys per environment:
# Development
agent_key = os.getenv("VALMI_AGENT_KEY_DEV", "agent_dev_abc123")

# Staging
agent_key = os.getenv("VALMI_AGENT_KEY_STAGING", "agent_staging_xyz789")

# Production
agent_key = os.getenv("VALMI_AGENT_KEY_PROD", "agent_prod_def456")

value.send_action(agent_key=agent_key, ...)

Environment Variables

Use environment variables for configuration:
# Development
export VALMI_API_KEY="sk_test_dev_abc123"
export VALMI_AGENT_KEY="agent_dev_abc123"
export VALMI_ENV="development"

# Staging
export VALMI_API_KEY="sk_test_staging_xyz789"
export VALMI_AGENT_KEY="agent_staging_xyz789"
export VALMI_ENV="staging"

# Production
export VALMI_API_KEY="sk_live_prod_def456"
export VALMI_AGENT_KEY="agent_prod_def456"
export VALMI_ENV="production"

Environment Isolation

Environments are fully isolated:
  • Data Isolation: No data sharing between environments
  • Key Isolation: Keys only work in their environment
  • Configuration Isolation: Separate configuration per environment

Best Practices

  • Separate Accounts: Use separate accounts for each environment
  • Different Keys: Use different keys per environment
  • Environment Variables: Use environment variables for configuration
  • No Production Data in Dev: Never use production data in development
  • Test in Staging: Always test in staging before production
  • Document Configuration: Document environment configuration

Deployment Workflow

  1. Development: Develop and test locally
  2. Staging: Deploy to staging for integration testing
  3. Production: Deploy to production after staging validation

Environment Management

Manage environments:
  • Create Environments: Set up new environments as needed
  • Sync Configuration: Keep configuration in sync (where appropriate)
  • Monitor Separately: Monitor each environment independently
  • Rotate Keys: Rotate keys per environment