.env file in the Site directory. An example file is provided at Site/.env.example.
Required Variables
The full URL origin of your Mercury Core site, including the protocol.
The port on which the Mercury Core site will listen.
The password for authenticating with your SMTP server. This corresponds to the
Username configured in the Email section of mercury.core.ts.Authentication key for the RCC service proxy.
The password, port, and RCCService key may be changed if required.
Authentication key for gameserver communication.
API key for Open Cloud services.
Optional Variables
Sets the maximum allowed size for request bodies. Useful for allowing large file uploads.See SvelteKit adapter-node documentation for details.
Example .env File
Here’s a complete example of a.env file:
Security Best Practices
- Use strong, unique passwords for all authentication keys
- Rotate credentials periodically
- Limit access to the
.envfile on your server - Use different credentials for development and production environments
- Consider using a secrets management service for production deployments
Loading Environment Variables
Mercury Core automatically loads environment variables from the.env file in the Site directory when the application starts. No additional configuration is needed.
For production deployments, you may want to set environment variables directly in your hosting environment rather than using a .env file.