Configure MediatR license via environment variables
mainMediatR supports auto-discovery of license keys via environment variables, which is ideal for containerized or cloud environments. The key is resolved using the following order of precedence (the first one found is used):
- Explicit value set in code (
cfg.LicenseKeyorMediator.LicenseKey). - The
MEDIATR_LICENSE_KEYenvironment variable. - The
LUCKYPENNY_LICENSE_KEYenvironment variable (a shared key for Lucky Penny products).
No code changes are required if using environment variables; simply register MediatR as usual.