Firebase Requests
Wized has a native Firebase integration, which makes it easy to make requests to your Firebase app to perform CRUD operations on Cloud Firestore.
Firebase is a popular Backend-as-a-Service (BaaS) that provides a real-time database. It is a NoSQL database that stores data in JSON-like documents.
How to get started?
Creating a project in the Firebase console
To start using Firebase, first, you need to create a project in the Firebase console. You'll see a screen similar to the one below.
Click on the Add Project
button and follow the on-screen prompts. Not much customization is needed for this sample app, so just clicking on continue for all steps with the default settings will be okay.
Adding an app to your project in the Firebase console
After successfully creating a project, you'll be presented with this screen where we should add our app.
Since what we are building is a web app, we will click on the </>
button, which will give us a set of credentials to use in Wized.
You'll then give it an appropriate name, and on the step of adding the Firebase SDK, we will choose to do so via script tags.
Copy the firebaseConfig
values for use in setting up the Firebase app in Wized.
Setting up Firebase in the Wized configurator
In the Wized configurator, go to My Apps
, then click on the +
button to add an app. Give the app an appropriate name, and under the App
option, choose Firebase
.
Next, transfer the data from the Firebase config copied earlier onto Wized. The final result will be as below:
Creating Cloud Firestore
After creating an app, we'll need to add a database to store our data, and that is where Cloud Firestore comes into play. Check out an example below of creating the Cloud Firestore and manually adding a document to it.
Securing your database
Firebase implements security rules to protect your data. It is very important that you take the time to understand how to write these rules to ensure your data is secure. Otherwise, anyone can potentially read or write to your database.
Check out the Firebase documentation for more information.