Cloud Functions Setup
All the Cloud Functions configuration you will need!
Requirements
- Ensure you have Firebase CLI installed on your device.
- Make sure you are logged into the correct Google account.
- Your Firebase project should be upgraded to the Blaze Plan in order to use Cloud Functions.
Steps to Setup Cloud Functions
Step 1: Enable Cloud Functions
- In the Firebase Console, go to Build → Functions from the sidebar.
- Upgrade your project to the Blaze Plan if not already done.
- Enable Functions in your project.
Step 2: Install Firebase Tools
- Open your project in Visual Studio Code.
- Open the terminal (Ctrl + `)
- Run the following command:
npm install -g firebase-tools
Step 3: Initialize Cloud Functions
- In the project terminal, run
firebase init functions
Answer the initialization questions as follows:
What language would you like to use to write Cloud Functions?
→ Select JavaScript
Do you want to use ESLint to catch probable bugs and enforce style?
→ Select No or type n
File functions/index.js already exists. Overwrite?
→ Select No or type n
▪ Important Note: Do not overwrite index.js, or the project functionality will not work properly.
Do you want to install dependencies with npm now?
→ Select Yes or type
Step 4: Deploy Cloud Functions
-- After initialization, deploy the functions by running the command:
firebase deploy --only functions
Once deployed, you can check the Cloud Functions section in the Firebase Console to confirm your functions are deployed successfully.
Conclusion
- By following these steps, your Cloud Functions will be properly initialized and deployed, ready to work with the Jhoom app.
Follow the video tutorial to set up Cloud Functions step by step