Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to initialize a Firebase app with the correct method.
Firebase
const app = firebase.[1](firebaseConfig); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'startApp' or 'createApp' which are not Firebase methods.
✗ Incorrect
The correct method to start a Firebase app is initializeApp.
2fill in blank
mediumComplete the code to get a reference to the Firestore database.
Firebase
const db = firebase.[1](); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'getFirestore' which is for the modular SDK.
✗ Incorrect
The correct function to get Firestore is firestore().
3fill in blank
hardFix the error in the AWS S3 bucket creation code by choosing the correct property name.
Firebase
const bucket = new AWS.S3({
[1]: 'us-west-2'
}); Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'regionName' or 'zone' which are invalid for AWS config.
✗ Incorrect
The correct property to specify AWS region is region.
4fill in blank
hardFill both blanks to create a Supabase client with the correct URL and key.
Firebase
const supabase = createClient('[1]', '[2]');
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using AWS URLs or secret keys instead of public keys.
✗ Incorrect
Supabase client needs the project URL and the public anonymous key.
5fill in blank
hardFill all three blanks to configure Firebase authentication with email and password provider.
Firebase
firebase.auth().createUserWithEmailAndPassword([1], [2]).then(user => { console.log([3]); });
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping password and email, or logging wrong variable.
✗ Incorrect
The method requires email and password as inputs, and the user object is returned in the promise.