-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Management
dev-mondoshawan edited this page Apr 16, 2026
·
2 revisions
**Referenced Files in This Document**
- [backend/src/config/index.js](https://github.com/RunTimeAdmin/AgentID/blob/main/backend/src/config/index.js)
- [backend/.env.example](https://github.com/RunTimeAdmin/AgentID/blob/main/backend/.env.example)
- [frontend/.env.example](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/.env.example)
- [backend/package.json](https://github.com/RunTimeAdmin/AgentID/blob/main/backend/package.json)
- [frontend/package.json](https://github.com/RunTimeAdmin/AgentID/blob/main/frontend/package.json)
- Introduction
- Environment Variables
- Backend Configuration
- Frontend Configuration
- Security Considerations
- Deployment Configuration
AgentID uses environment-based configuration management to handle different deployment environments (development, staging, production). Configuration is centralized in the backend config module and loaded from environment variables.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://user:pass@localhost:5432/agentid |
REDIS_URL |
Redis connection string | redis://localhost:6379 |
BAGS_API_KEY |
API key for Bags integration | bags_api_key_xxx |
SAID_GATEWAY_URL |
SAID Identity Gateway endpoint | https://said.example.com |
AGENTID_BASE_URL |
Public base URL for the service | https://agentid.provenanceai.network |
| Variable | Description | Default |
|---|---|---|
PORT |
Server port | 3002 |
NODE_ENV |
Environment mode | development |
CORS_ORIGIN |
Allowed CORS origin | * |
BADGE_CACHE_TTL |
Badge cache TTL (seconds) | 60 |
CHALLENGE_EXPIRY_SECONDS |
Challenge expiration (seconds) | 300 |
The backend configuration module (backend/src/config/index.js) centralizes all environment variables:
module.exports = {
port: process.env.PORT || 3002,
nodeEnv: process.env.NODE_ENV || 'development',
databaseUrl: process.env.DATABASE_URL,
redisUrl: process.env.REDIS_URL,
bagsApiKey: process.env.BAGS_API_KEY,
saidGatewayUrl: process.env.SAID_GATEWAY_URL,
baseUrl: process.env.AGENTID_BASE_URL,
corsOrigin: process.env.CORS_ORIGIN || '*',
badgeCacheTtl: parseInt(process.env.BADGE_CACHE_TTL) || 60,
challengeExpirySeconds: parseInt(process.env.CHALLENGE_EXPIRY_SECONDS) || 300
};Frontend configuration is handled through Vite's environment variable system:
-
VITE_API_BASE_URL: Backend API base URL -
VITE_WIDGET_BASE_URL: Widget serving base URL
- Never commit
.envfiles to version control - Use strong, unique API keys for production
- Enable SSL/TLS for all external connections
- Use secrets management in production (e.g., AWS Secrets Manager, HashiCorp Vault)
When running in Docker, pass environment variables via:
- Docker Compose
environmentsection - Docker secrets for sensitive values
- Kubernetes ConfigMaps and Secrets
- All required environment variables are set
- Database and Redis connections use SSL
- CORS origin is restricted to known domains
- Rate limiting is enabled
- Debug logging is disabled