ideogram-multi-env-setup
Configure Ideogram across development, staging, and production environments.Use when setting up multi-environment deployments, configuring per-environment secrets,or implementing environment-specific Ideogram configurations.Trigger with phrases like "ideogram environments", "ideogram staging","ideogram dev prod", "ideogram environment setup", "ideogram config by env".
When & Why to Use This Skill
The Ideogram Multi-Environment Setup skill automates the complex process of configuring Ideogram API integrations across development, staging, and production environments. It provides a robust framework for managing environment-specific secrets, implementing secure environment detection, and establishing production safeguards to ensure reliable and scalable AI image generation workflows. By streamlining the setup of API keys and configuration overrides, it helps developers maintain high security standards and operational consistency across the entire software development lifecycle (SDLC).
Use Cases
- Automated Environment Configuration: Quickly generate structured configuration files (base, dev, staging, prod) to manage different API keys, base URLs, and timeout settings for Ideogram.
- Secure Secret Management: Integrate with AWS Secrets Manager, GCP Secret Manager, or HashiCorp Vault to securely handle sensitive Ideogram credentials and prevent hardcoding secrets in source code.
- Production Safeguards and Isolation: Implement environment-aware guards and logic to prevent high-risk operations (like data deletion) from being accidentally executed in non-production environments.
- CI/CD Pipeline Integration: Streamline the injection of environment-specific variables into GitHub Actions or other deployment pipelines for seamless, automated multi-stage deployments.
- Feature Flag Management: Configure environment-specific feature flags to test new Ideogram capabilities in staging before rolling them out to production users.
| name | ideogram-multi-env-setup |
|---|---|
| description | | |
| allowed-tools | Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*) |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Ideogram Multi-Environment Setup
Overview
Configure Ideogram across development, staging, and production environments.
Prerequisites
- Separate Ideogram accounts or API keys per environment
- Secret management solution (Vault, AWS Secrets Manager, etc.)
- CI/CD pipeline with environment variables
- Environment detection in application
Environment Strategy
| Environment | Purpose | API Keys | Data |
|---|---|---|---|
| Development | Local dev | Test keys | Sandbox |
| Staging | Pre-prod validation | Staging keys | Test data |
| Production | Live traffic | Production keys | Real data |
Configuration Structure
config/
├── ideogram/
│ ├── base.json # Shared config
│ ├── development.json # Dev overrides
│ ├── staging.json # Staging overrides
│ └── production.json # Prod overrides
base.json
{
"timeout": 30000,
"retries": 3,
"cache": {
"enabled": true,
"ttlSeconds": 60
}
}
development.json
{
"apiKey": "${IDEOGRAM_API_KEY}",
"baseUrl": "https://api-sandbox.ideogram.com",
"debug": true,
"cache": {
"enabled": false
}
}
staging.json
{
"apiKey": "${IDEOGRAM_API_KEY_STAGING}",
"baseUrl": "https://api-staging.ideogram.com",
"debug": false
}
production.json
{
"apiKey": "${IDEOGRAM_API_KEY_PROD}",
"baseUrl": "https://api.ideogram.com",
"debug": false,
"retries": 5
}
Environment Detection
// src/ideogram/config.ts
import baseConfig from '../../config/ideogram/base.json';
type Environment = 'development' | 'staging' | 'production';
function detectEnvironment(): Environment {
const env = process.env.NODE_ENV || 'development';
const validEnvs: Environment[] = ['development', 'staging', 'production'];
return validEnvs.includes(env as Environment)
? (env as Environment)
: 'development';
}
export function getIdeogramConfig() {
const env = detectEnvironment();
const envConfig = require(`../../config/ideogram/${env}.json`);
return {
...baseConfig,
...envConfig,
environment: env,
};
}
Secret Management by Environment
Local Development
# .env.local (git-ignored)
IDEOGRAM_API_KEY=sk_test_dev_***
CI/CD (GitHub Actions)
env:
IDEOGRAM_API_KEY: ${{ secrets.IDEOGRAM_API_KEY_${{ matrix.environment }} }}
Production (Vault/Secrets Manager)
# AWS Secrets Manager
aws secretsmanager get-secret-value --secret-id ideogram/production/api-key
# GCP Secret Manager
gcloud secrets versions access latest --secret=ideogram-api-key
# HashiCorp Vault
vault kv get -field=api_key secret/ideogram/production
Environment Isolation
// Prevent production operations in non-prod
function guardProductionOperation(operation: string): void {
const config = getIdeogramConfig();
if (config.environment !== 'production') {
console.warn(`[ideogram] ${operation} blocked in ${config.environment}`);
throw new Error(`${operation} only allowed in production`);
}
}
// Usage
async function deleteAllData() {
guardProductionOperation('deleteAllData');
// Dangerous operation here
}
Feature Flags by Environment
const featureFlags: Record<Environment, Record<string, boolean>> = {
development: {
newFeature: true,
betaApi: true,
},
staging: {
newFeature: true,
betaApi: false,
},
production: {
newFeature: false,
betaApi: false,
},
};
Instructions
Step 1: Create Config Structure
Set up the base and per-environment configuration files.
Step 2: Implement Environment Detection
Add logic to detect and load environment-specific config.
Step 3: Configure Secrets
Store API keys securely using your secret management solution.
Step 4: Add Environment Guards
Implement safeguards for production-only operations.
Output
- Multi-environment config structure
- Environment detection logic
- Secure secret management
- Production safeguards enabled
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Wrong environment | Missing NODE_ENV | Set environment variable |
| Secret not found | Wrong secret path | Verify secret manager config |
| Config merge fails | Invalid JSON | Validate config files |
| Production guard triggered | Wrong environment | Check NODE_ENV value |
Examples
Quick Environment Check
const env = getIdeogramConfig();
console.log(`Running in ${env.environment} with ${env.baseUrl}`);
Resources
Next Steps
For observability setup, see ideogram-observability.