Links
Comment on page

Configuration

Overview

The configuration variables related to your app are stored in /assets/custom/js/config.js file.
You can store configuration variables such as app settings, API keys related to third-party services inside this file.
The example structure for storing variables is:
window.config.facebook {
appId: '12345678987654321'
}
In the same way, you can store config variables inside window.config object.

Accessing Configuration Variables

You can access these variables from inside JavaScript or from inside the HTML template literals.
// Accessing from inside JavaScript
console.log(window.config.facebook.appId);
// Or you can also access this way, once your app is initialized.
console.log(app.config.facebook.appId); // This is the recommended way
<!-- Accessing from inside HTML template literals -->
<template>
<div>${$f7.config.facebook.appId}}</div> <!-- After parsing, the output will be 12345678987654321 -->
</template>