Your connection token is available on the Minded platform in the agent page within the GitHub integration popup. You can also use the npx command provided there to automatically set the minded token.
Example .env File
Here's a complete example of a .env file:
Loading Environment Variables
MindedJS automatically loads environment variables from your .env file. Make sure to:
Create the .env file in your project root
Add .env to your .gitignore file to keep credentials secure
Never commit your .env file to version control
Runtime Environment Detection
MindedJS uses specific environment variables to determine the runtime environment and adjust behavior accordingly.
// Check if running on Minded Cloud
if (process.env.MINDED_CLOUD === 'true') {
// Running on Minded infrastructure (dev/staging/prod)
logger.info({ message: 'Running on Minded Cloud' });
}
// Check specific environment
if (process.env.NODE_ENV === 'production' && process.env.MINDED_CLOUD === 'true') {
// Production environment on Minded Cloud
logger.info({ message: 'Production mode' });
}
const isDevelopment = process.env.NODE_ENV === 'development';
const isMindedCloud = process.env.MINDED_CLOUD === 'true';
// Enable debug features only in development
if (isDevelopment) {
// Enable verbose logging
logger.setLevel('debug');
}
// Use different endpoints based on environment
const apiEndpoint = isMindedCloud ? 'https://api.minded.com' : 'http://localhost:3000';