Skip to content

medusa configuration

Your service's config class extends MedusaConfig with its own variables and loads it once at startup. Loading fails and names the variable when a required one is missing. A secret is removed from process.env once it is read.

import { type EnviConfig, envfield } from "@evolve-framework/config";
import { MedusaConfig } from "@evolve-framework/medusa";
class Config extends MedusaConfig {
readonly HTTP_PORT = 8080;
config(): EnviConfig {
return { ...super.config(), HTTP_PORT: envfield.number() };
}
}
export const config = new Config();
await config.load();

MedusaConfig

Everything the adapter needs to talk to Medusa — and nothing that would let it act as an administrator.

import { MedusaConfig } from "@evolve-framework/medusa";
VariableDescription
MEDUSA_API_URLrequiredThe Medusa server's URL, the base of its Store API.
MEDUSA_STORESrequired · objectThe stores this service serves, as JSON keyed by store key, each with its publishableKey. A store without one fails the load.
MEDUSA_REQUEST_TIMEOUToptional · numberMilliseconds a request to Medusa may take, reading the response included, before it is aborted with a TimeoutError. Default 10000; 0 means no limit.Default 10000

Every service's variables on one page: Configuration.