Follow Best Practices
Deployment Best Practices
Security
1. Use public variables for transparency
# .env
VERSION_PUBLIC=1.0.0
NETWORK_PUBLIC=sepolia
SECRET_API_KEY=secret-here # Private
2. Rotate secrets regularly
# Update API keys periodically
vim .env
eigenx app upgrade my-app
Reliability
1. Health checks in your app
// Example health endpoint
app.get('/health', (req, res) => {
res.json({ status: 'healthy', version: process.env.VERSION_PUBLIC })
})
2. Graceful shutdown
process.on('SIGTERM', async () => {
console.log('SIGTERM received, shutting down gracefully')
await cleanup()
process.exit(0)
})
3. Logging
console.log('App started')
console.error('Error occurred:', error)
// Logs are visible via: eigenx app logs