October 2017
Intermediate to advanced
302 pages
7h 27m
English
We need to move our API key and messagingSenderId to a separate file, and then ensure that the file is not checked into Git:
window.apiKey = "YOUR-API-KEY”messagingSenderId = "YOUR-SENDER-ID"
Again, we're taking advantage of the globally accessible window object to store the key. For those of you new to JavaScript, note that it is not good practice to abuse the window object; only use it when absolutely necessary.
<script src="/secrets.js"></script>
<script> // Initialize Firebase var config = { apiKey: ...Read now
Unlock full access