OpenEvidence Multi-Environment Setup
Table of Contents
Overview
Configure and manage OpenEvidence integrations across development, staging, and production environments with proper isolation, secret management, and promotion strategies.
Prerequisites
- OpenEvidence accounts for each environment
- Separate API keys per environment
- Infrastructure for each environment
- CI/CD pipeline configured
Environment Strategy
| Environment |
API Endpoint |
Purpose |
Data |
| Development |
sandbox.openevidence.com |
Local development |
Synthetic |
| Staging |
sandbox.openevidence.com |
Integration testing |
Synthetic |
| Production |
api.openevidence.com |
Live clinical use |
Real (PHI) |
Instructions
Step 1: Create Environment Configs
Define per-environment settings for baseUrl, timeout, retries, rate limiting, cache TTL, logging level, and feature flags (deepConsult, webhooks, auditLogging).
Step 2: Build Configuration Loader
Create a config loader that selects the right environment config based on NODE_ENV, with env var overrides for apiKey, orgId, baseUrl, and timeout.
Step 3: Environment-Aware Client Factory
Implement OpenEvidenceClientFactory with per-environment singleton instances and test injection support.
Step 4: Set Up Secret Management
Use .env for development, GCP Secret Manager for staging/production. Define secret paths per environment with separate projects.
Step 5: Create Promotion Workflow
Build GitHub Actions workflow for staging-to-production promotion with version validation, smoke tests, and gradual traffic shifting (10% -> 50% -> 100%).
Step 6: Implement Health Checks
Create environment-aware health check that validates OpenEvidence connectivity, cache status, and database health.
Output
- Environment-specific configuration files (dev/staging/prod)
- Configuration loader with env var overrides
- Client factory with per-environment singletons
- Secret management per environment (GCP Secret Manager)
- GitHub Actions promotion workflow
- Health check endpoint
Error Handling
| Environment Issue |
Detection |
Resolution |
| Wrong API endpoint |
Health check fails |
Verify baseUrl in config |
| Secret not found |
Startup failure |
Check Secret Manager permissions |
| Config mismatch |
Unexpected behavior |
Validate config loading |
| Promotion failure |
CI/CD error |
Check version tagging |
Examples
Environment Config Summary
- Dev: sandbox API, no rate limiting, debug logging, cache disabled
- Staging: sandbox API, rate limited (60/min), info logging, 30min cache
- Production: production API, rate limited (300/min), warn logging, 1hr cache
See detailed implementation for advanced patterns.
Resources
1---2name: openevidence-multi-env-setup3description: |4 Configure OpenEvidence across development, staging, and production environments.5 Use when setting up multiple environments, managing environment-specific configurations,6 or implementing environment promotion strategies for clinical AI applications.7 Trigger with phrases like "openevidence environments", "openevidence staging",8 "openevidence dev setup", "multi-environment openevidence".9allowed-tools: Read, Write, Edit10version: 1.0.011license: MIT12author: Jeremy Longshore <jeremy@intentsolutions.io>13compatible-with: claude-code, codex, openclaw14metadata:15 source: https://skillmd.com/skills/micsapp/openevidence-multi-env-setup16---1718# OpenEvidence Multi-Environment Setup1920## Table of Contents21- [Overview](#overview)22- [Prerequisites](#prerequisites)23- [Instructions](#instructions)24- [Output](#output)25- [Error Handling](#error-handling)26- [Examples](#examples)27- [Resources](#resources)2829## Overview30Configure and manage OpenEvidence integrations across development, staging, and production environments with proper isolation, secret management, and promotion strategies.3132## Prerequisites33- OpenEvidence accounts for each environment34- Separate API keys per environment35- Infrastructure for each environment36- CI/CD pipeline configured3738## Environment Strategy3940| Environment | API Endpoint | Purpose | Data |41|-------------|--------------|---------|------|42| Development | sandbox.openevidence.com | Local development | Synthetic |43| Staging | sandbox.openevidence.com | Integration testing | Synthetic |44| Production | api.openevidence.com | Live clinical use | Real (PHI) |4546## Instructions4748### Step 1: Create Environment Configs49Define per-environment settings for baseUrl, timeout, retries, rate limiting, cache TTL, logging level, and feature flags (deepConsult, webhooks, auditLogging).5051### Step 2: Build Configuration Loader52Create a config loader that selects the right environment config based on `NODE_ENV`, with env var overrides for apiKey, orgId, baseUrl, and timeout.5354### Step 3: Environment-Aware Client Factory55Implement `OpenEvidenceClientFactory` with per-environment singleton instances and test injection support.5657### Step 4: Set Up Secret Management58Use `.env` for development, GCP Secret Manager for staging/production. Define secret paths per environment with separate projects.5960### Step 5: Create Promotion Workflow61Build GitHub Actions workflow for staging-to-production promotion with version validation, smoke tests, and gradual traffic shifting (10% -> 50% -> 100%).6263### Step 6: Implement Health Checks64Create environment-aware health check that validates OpenEvidence connectivity, cache status, and database health.6566## Output67- Environment-specific configuration files (dev/staging/prod)68- Configuration loader with env var overrides69- Client factory with per-environment singletons70- Secret management per environment (GCP Secret Manager)71- GitHub Actions promotion workflow72- Health check endpoint7374## Error Handling75| Environment Issue | Detection | Resolution |76|-------------------|-----------|------------|77| Wrong API endpoint | Health check fails | Verify baseUrl in config |78| Secret not found | Startup failure | Check Secret Manager permissions |79| Config mismatch | Unexpected behavior | Validate config loading |80| Promotion failure | CI/CD error | Check version tagging |8182## Examples8384### Environment Config Summary85- **Dev**: sandbox API, no rate limiting, debug logging, cache disabled86- **Staging**: sandbox API, rate limited (60/min), info logging, 30min cache87- **Production**: production API, rate limited (300/min), warn logging, 1hr cache8889See [detailed implementation](${CLAUDE_SKILL_DIR}/references/implementation.md) for advanced patterns.9091## Resources92- [OpenEvidence Sandbox](https://sandbox.openevidence.com/)93- [Google Cloud Secret Manager](https://cloud.google.com/secret-manager)