The Meteor Settings File
Learn about the MeteorJS settings file and understand its sections.
We'll cover the following...
The settings file
Meteor provides a way to store information such as keys and configuration data in a JSON file. This JSON file is added to the root of our project. We can call the file whatever we want, but the convention is that it’s usually named settings.json
.
A JSON file is a human-readable file that ends in a .JSON
file extension. It normally consists of an object with key-value pairs. Meteor exposes the values in the JSON file through the Meteor.settings
object. Below is an example of a settings file:
{"googleAPI" : "Qrtgeheh34525262","magicNumber" : "0404oio44o4oo4"}
The values in the settings file can only be accessed at the server. If we want to access it at the client, we should nest a public key in our settings object.
{"public" : {"clientAPI": "23441990Educative","learningSecret": "secret147"},"private": {"googleAnalyticsAPI": "536tyyyyy00hhggg","facebookAPI": "yryryyryryry7477474"}}
Nesting private and public keys
Keys nested on the public object ...