Firebase
Firebase is a comprehensive platform provided by Google that offers a wide range of tools and services for developing and managing web and mobile applications. It provides developers with a scalable and secure backend infrastructure, along with a suite of pre-built features and functionalities to accelerate the development process. With the integration of Firebase on ILLA Cloud, developers can enhance their applications with reliable and scalable storage solutions, enabling them to focus on building innovative and data-driven experiences.
Create Firebase API
There are two ways to create a resource in Illa after signing into your Illa account.
- Create in Resources
Sign in to your Illa account, select **Resources**
on the top of the page, and click **Create New**
button.
Select Firebase
from the API list.
Connect to the database with the required parameters described in Connection Settings
below.
Click **Test Connection**
to see if we can successfully connect to the database. If yes, click Save Resources
, else, double check the hostname, port, username, and password is correct.
After creating a resource, the ready Firebase will display as shown.
- Create in Builder
Sign into your Illa account, create a project in Illa Builder on the **App**
page, and navigate to the Action List
at the bottom of the page. Click **new**
, then select Firebase
from the database list. Then, connect to the database with the required parameters described in Connection Settings
below.
Click **Test Connection**
to see if we can successfully connect to the database. If yes, click Save Resources
, else, double check the hostname, port, username, and password is correct.
Connection Settings
Here we need to provide information for connecting to Firebase API.
Properties | Required | Description |
---|---|---|
Name | required | The name for resource when creating actions in the ILLA. |
Firebase Database URL | optional | the endpoint or URL where the Firebase Realtime Database is hosted |
Firestore Project ID | optional | a unique identifier assigned to each Firebase project that uses the Firestore database service |
Private Key | required | a security credential used for authenticating and accessing Firebase services programmatically |
Create Actions
We have created a Firebase resource, we can add the action by selecting Firebase from the action list and choosing the Create action
button.
Now we have added the Firebase server as an action to our building page.
Configure Firebase
Overview
Service Type | Firebase Auth | Firestore | Realtime Database |
---|---|---|---|
Action Type | Get user by UID | Query Firebase, | Query Database |
Get user by email | Insert Document | Set data | |
Get user by phone number | Update Document | Update data | |
Create a user | Get document by ID | Append data to a list | |
Update a user | Delete a Document | ||
Delete a user | Get Collections | ||
List user | Query Collection Group | ||
Transformer | transforming data into the style you like using JavaScript |
Get user by UID
retrieve user information by specifying the user's unique identifier (UID). It enables you to fetch user details such as display name, email, phone number, and custom attributes associated with the user.
Input
Properties | Required | Description |
---|---|---|
UID | required | "User Identifier." It is a unique identifier assigned to each user in the Firebase authentication system. |
Get user by email
retrieve user information by specifying the user's email address. It allows you to fetch user details similar to the UID-based method, but using the email as the identifier.
Input
Properties | Required | Description |
---|---|---|
required | the registered email associated with the user you want to retrieve |
Get user by phone number
retrieve user information by specifying the user's phone number. It allows you to fetch user details similar to the UID-based method, but using the phone number as the identifier.
Input
Properties | Required | Description |
---|---|---|
phone number | required | the registered phone number associated with the user you want to retrieve |
Create a user
create a new user in the Firebase authentication system. You can provide the user's email, password, display name, and other relevant information during the user creation process.
Input
Properties | Required | Description |
---|---|---|
User object | required | an object that contains user's information |
Update a user
update the attributes and properties of an existing user. You can modify the user's display name, email, phone number, password, and other custom attributes associated with the user.
Input
Properties | Required | Description |
---|---|---|
UID | required | "User Identifier." It is a unique identifier assigned to each user in the Firebase authentication system. |
User object | required | an object that contains user's information |
Delete a user
delete a user from the Firebase authentication system. This action permanently removes the user and their associated data from the system.
Input
Properties | Required | Description |
---|---|---|
UID | required | "User Identifier." It is a unique identifier assigned to each user in the Firebase authentication system. |
List users
retrieve a list of all users registered in the Firebase authentication system. It provides paginated results, enabling you to iterate through the user list and retrieve specific user details.
Input
Properties | Required | Description |
---|---|---|
Length of list | optional | number of users you want to retrieve in a single request |
Next page token | optional | pagination when there are more users than can be returned in a single response |
Query Firebase
perform queries on the database using various conditions and filters
Input
Properties | Required | Description |
---|---|---|
Collection | required | can use dropdown to select or use a raw id |
where | required | add conditions to your query |
limit | optional | limit the number of documents returned by the query. |
Order by | optional | specify the field by which you want to order the query results |
Ordering direction | optional | the direction of the ordering in the query results |
Insert Document
create a new document in a collection or subcollection within Firestore. You provide the data to be stored in the document, and Firebase assigns a unique identifier (document ID) to it.
Input
Properties | Required | Description |
---|---|---|
Collection | required | specifies the name of the collection in which you want to insert the document. can use the dropdown to select or use a raw id |
Document ID | optional | specify a custom identifier for the document being inserted |
value | required | the actual data that you want to insert into the document |
Update Document
update an existing document in Firestore. You specify the document ID and provide the updated data, which will overwrite the existing document's fields.
Input
Properties | Required | Description |
---|---|---|
Collection | required | specifies the name of the collection in which you want to update the document. can use the dropdown to select or use a raw id |
Document ID | optional | specify a custom identifier for the document being updated |
value | required | the actual data that you want to update into the document |
Get Document by ID
retrieves a specific document from Firestore based on its unique document ID
Input
Properties | Required | Description |
---|---|---|
Collection | required | specifies the name of the collection in which you want to retrieve the document. can use the dropdown to select or use a raw id |
Document ID | optional | specify a custom identifier for the document being retrieved |
Delete a Document
remove a document from Firestore based on its document ID
Input
Properties | Required | Description |
---|---|---|
Collection | required | specifies the name of the collection in which you want to retrieve the document. can use the dropdown to select or use a raw id |
Document ID | optional | specify a custom identifier for the document being retrieved |
Get Collections
retrieve all the collections within a Firestore database. It returns a list of collection names available in the database.
Input
Properties | Required | Description |
---|---|---|
Parent Document ID | optional | specify a custom identifier for the document being retrieved |
Query Collection Group
query documents across multiple collections with the same name. You can perform complex queries and retrieve matching documents from different collections that share the same name.
Input
Properties | Required | Description |
---|---|---|
Collection | required | can use dropdown to select or use a raw id |
where | required | add conditions to your query |
limit | optional | limit the number of documents returned by the query. |
Order by | optional | specify the field by which you want to order the query results |
Ordering direction | optional | the direction of the ordering in the query results |
Query database
query the Realtime Database to retrieve data that meets specific criteria. You can define filters, sorting, and other conditions to retrieve a subset of data from a particular location in the database.
Input
Properties | Required | Description |
---|---|---|
Database ref | required | a reference to a specific location in the database. |
Set data
write or replace data at a specific location in the Realtime Database
Input
Properties | Required | Description |
---|---|---|
Database ref | required | a reference to a specific location in the database. |
Object to set | required | object contains the data that we want to write to the database, including the name, age, and email fields. |
Update data
modify existing data at a specific location in the Realtime Database
Input
Properties | Required | Description |
---|---|---|
UID | required | "User Identifier." It is a unique identifier assigned to each user in the Firebase authentication system. |
User object | required | object contains the data that we want to update to the database, including the name, age, and email fields. |
Append data to a list
use the "Push" method. It generates a unique key and appends the data as a new element in the list.
Input
Properties | Required | Description |
---|---|---|
Database ref | required | a reference to a specific location in the database. |
Object to set | required | object contains the data that we want to update to the database, including the name, age, and email fields. |