From 39b8a75f75641429a3013ee3a979731ac7c9fbbe Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sat, 27 Jun 2026 23:34:49 +0200 Subject: [PATCH 1/2] docs(introduction): clarify usage of functions in config.js for browser availability --- configuration/introduction.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configuration/introduction.md b/configuration/introduction.md index 9e871714..57e7383c 100644 --- a/configuration/introduction.md +++ b/configuration/introduction.md @@ -96,6 +96,11 @@ debugging: server security header behavior. - `hideConfigSecrets` is documented in detail in [Secrets](./secrets). +When you use functions in `config.js`, keep them inside the exported `config` +object if they need to be available in the browser. MagicMirror² serves the +browser copy of the configuration from the `config` object, so free-standing +helper functions outside that object are not included there. + #### Bash Environment variables There are two environment variables that override part or all of config.js. They From 495c76799c1a50299bc91858ae8231f3a76176f5 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 28 Jun 2026 00:10:06 +0200 Subject: [PATCH 2/2] docs(introduction): add export statement for config in config.js example --- configuration/introduction.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configuration/introduction.md b/configuration/introduction.md index 57e7383c..ec9709b4 100644 --- a/configuration/introduction.md +++ b/configuration/introduction.md @@ -19,6 +19,9 @@ }, ], }; + + /*************** DO NOT EDIT THE LINE BELOW ***************/ + if (typeof module !== "undefined") {module.exports = config;} ``` See [module configuration](/modules/configuration) for more information and