Firebase Auth
Last updated
Last updated
© 2024 UI Bakery
UI Bakery allows you to easily connect to a Firebase's Admin API with no need for additional layers (APIs or 3rd-party services). You can connect to Firebase, Realtime DB and Auth.
To connect to your Firebase services, you will need one or several of the below credentials:
Firebase project ID: navigate the Firebase console, and copy the project ID of the required project.
Firebase database URL: navigate your project, and select Realtime Database from the left side menu. Copy your project URL (the pattern is https://your_project.firebaseio.com/) and paste it into UI Bakery.
Private key: navigate the project settings - Service accounts. Select Firebase Admin SDK and click Generate new private key.
To connect Firebase as a data source, follow the below steps:
navigate the Data sources - Connect. Select Firebase Auth, Realtime Database or Firestore depending on your service. Specify the required credentials to continue the setup.
for Firebase Auth, specify the Private key:
for Realtime DB, specify the Private key and the Firebase database URL:
for Firestore, specify the project ID and the private key:
click Connect data source to complete the setup.
To query the Realtime database, select a Firebase Query in the actions list and select your Realtime DB from the data sources list. Next, select Query as a Realtime database method. Specify your database ref.
To enable additional filtering options, switch on the Use ordering toggle. Available filters:
ordering by child, key, value, or priority;
ordering by limit (limit to first/ to last);
filtering queries with equalTo
, startAt
, endAt
.
In Firebase database, you can use two approaches to updating data: set
and update
.
set
rewrites the current values of an item;
update
updates the required values of an item, but doesn't rewrite all the values of an object
To use the set
method, select it from the action dropdown, specify the database ref and a data object.
To use the update
method, select it from the dropdown, specify the database ref and a data object.
To get a list of your collections, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Choose Get collection list as a Firestore method. Provide a Parent document ID or leave blank for top level collections.
To query Firestore, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Next, select Query as a Firestore method. Specify your collection name. You can filter your query by values, add limits, add ordering by a certain field.
To get a document by ID, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Select Get document by ID as a Firestore method and specify the collection name and a document ID. Document ID can receive dynamic values passed in {{}}
.
To update a document, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Next, select Update document as a Firestore method. Specify the collection name, a document ID and objects that need to be updated. Document ID and values can receive dynamic values passed in {{}}
.
To insert a document, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Then, select Insert document as a Firestore method. Since the pattern of document insert is the same as for updating a document, you can leave a document ID blank, and Firestore will generate it automatically.
To delete a document, select a Firebase Query in the actions list and select your Firestore data source from the data sources list. Choose Delete document as a Firestore method, and only provide the document ID. Document ID can receive dynamic values passed in {{}}
.
With UI Bakery, you can manage your users from the Firebase Authentication setup, namely view, update, create new and delete existing users.
To get a list of your users, select a Firebase Query in the actions list and select your Firestore auth data source from the data sources list. Choose List users as a Firebase Auth method. You can limit the number of returned users if required.
To get a certain user by their UID, phone number or email, select a Firebase Query in the actions list and select your Firestore auth data source from the data sources list. Choose Get user by UID/ email/ phone number as a Firebase Auth method.
To create a new user, select a Firebase Query in the actions list and select your Firestore auth data source from the data sources list. Set Create user as a Firebase Auth method and provide a user object.
To update user's information, select a Firebase Query in the actions list and select your Firestore auth data source from the data sources list. Choose Update user as a Firebase Auth method. Specify user's UID and the update object.
To delete a user, select a Firebase Query in the actions list and select your Firestore auth data source from the data sources list. Choose Delete user as a Firebase Auth method and specify user's UID.