Skip to content

Commit 514dfb0

Browse files
authored
Update index.html
1 parent 12c3fcc commit 514dfb0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

1-70-0/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,50 @@
312312
</div>
313313

314314
<div id="membership-flow"></div>
315+
316+
<!-- This basically loads all of the Firebase stuff we're gonna need for Google auth and autosaving. -->
317+
<script type="module">
318+
319+
// Make sure to periodically check for updates, and make sure the Firebase SDKs are up-to-date :)
320+
import { initializeApp } from 'https://www.gstatic.com/firebasejs/11.1.0/firebase-app.js'
321+
// Add Firebase products that you want to use
322+
import { getAuth, GoogleAuthProvider, getIdToken, onAuthStateChanged, reauthenticateWithPopup, signInWithPopup } from 'https://www.gstatic.com/firebasejs/11.1.0/firebase-auth.js'
323+
import { getDatabase, child, get, ref, remove, set } from 'https://www.gstatic.com/firebasejs/11.1.0/firebase-database.js'
324+
325+
// Your web app's Firebase configuration
326+
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
327+
const firebaseConfig = {
328+
apiKey: "AIzaSyDJQjXklRBN4r3CZ9Be8uy1RLRZFcmXW_Q",
329+
authDomain: "prodigyretro-183a4.firebaseapp.com",
330+
databaseURL: "https://prodigyretro-183a4-default-rtdb.firebaseio.com",
331+
projectId: "prodigyretro-183a4",
332+
storageBucket: "prodigyretro-183a4.firebasestorage.app",
333+
messagingSenderId: "934355530489",
334+
appId: "1:934355530489:web:e388db01b27a2278386828",
335+
measurementId: "G-BVG8M7JCSG"
336+
};
337+
// Initialize Firebase
338+
const app = initializeApp(firebaseConfig);
339+
340+
// Firebase products we'll be using.
341+
const auth = getAuth(app);
342+
const database = getDatabase(app);
343+
344+
// Make sure the rest of the game can use the Firebase stuff.
345+
globalThis.firebase = {
346+
app,
347+
auth,
348+
database,
349+
utils: {
350+
db: {
351+
child, get, ref, remove, set
352+
},
353+
auth: {
354+
GoogleAuthProvider, getIdToken, onAuthStateChanged, reauthenticateWithPopup, signInWithPopup
355+
}
356+
}
357+
}
358+
</script>
315359
<script src="./js/lodash.min.js"></script>
316360
<script src="./js/phaser.min.js"></script>
317361
<script src="./js/easystar-0.2.0.min.js"></script>

0 commit comments

Comments
 (0)