Configuration

The configuration variables related to your app are stored inside /assets/custom/js/config.js file.

You can store configuration variables such as API keys related to third-party services inside this file.

The example structure of storing variables is —

window.config.facebook {
appId: '12345679098765431'
}

You can access these variables from inside JavaScript or from inside the HTML template.

// 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.data.config.facebook.appId); // This is the recommended way
<!-- Accessing from inside HTML template -->
<template>
<div>{{$root.config.facebook.appId}}</div> <!-- After parsing, the output will be 12345679098765431 -->
</template>