Firebase Auth, Firestore & Storage (plugin)
  • 🚀Getting Started
  • Setup
    • Create a Firebase Project
    • Get Firebase access credentials
    • Offline Support
    • Secure your credentials and data
      • Restrict your api-key to your domain
      • Security Rules on Firebase
  • Plugin Elements
    • 🛠️About elements
    • 💾Data Schemas
    • Firebase Auth (Current User)
    • Firestore Data List
      • Firebase Geohash
      • Firestore Data (legacy)
    • Firestore Data Extractor
    • Firestore Data Single
    • Firestore Data Aggregation
    • Firestore Data Processor
    • Firebase Storage Upload Button
    • Firebase Action Listener
    • Firebase Dropdown Processor
  • Plugin Front-end Actions
    • 💻About front-end actions
    • 💾Field types table
    • Firestore
      • Create a new document
      • Update a document
      • Delete a document
      • Update a list of documents
      • Delete a list of documents
      • Batch Operations
        • Batch Operation Constructor
        • Batch Operation Commit
    • Firebase Auth
      • Sign the User Up
      • Log the User In
      • Log the User In with Google
      • Log the User In with Facebook
      • Log the User In with GitHub
      • Log the User Out
      • Update User's Profile
      • Update User's Password
      • Update User's Email
      • Send password reset email
        • Handle reset password code
      • Send verification email
        • Handle verify email code
      • Delete current user
    • Firebase Storage
      • Upload file base64
      • Delete uploaded file
  • Plugin Back-end Actions
    • ☁️About backend actions
    • Firestore Backend
      • Get a list of documents
      • Get a single document
      • Count a list of documents
      • Create a new document
      • Update a document
      • Delete a document
      • Update a list of documents
      • Delete a list of documents
    • Firebase Auth Backend
      • Create an account for someone else
      • Update another user's profile info
      • Delete a user account
      • Generate email confirmation link
      • Generate password reset link
      • Set user roles
Powered by GitBook
On this page
  • Settings
  • Users Collection Name
  • Fields
  • Field Types
  • States and Values
  • User ID
  • User Email
  • User Photo URL
  • User Display Name
  • Fields (1, 2, 3...)
  • User Document
  • Auth Provider
  • Email Verified
  • Created At
  • Last Login At
  • Access Token
  • Refresh Token
  • Data is Ready
  • Element Actions
  • Refresh a Firebase Auth (Current User)
  • Events
  • User is logged in
  • User is logged out
  • Data ready or changed
  1. Plugin Elements

Firebase Auth (Current User)

PreviousData SchemasNextFirestore Data List

Last updated 11 months ago

The Firebase Auth element was created to work as a substitute to Bubble's "Current User" value. So you can use to retrieve data and the authentication state from the user logged in through Firebase.


Settings

Users Collection Name

Here you must specify the id (or name) of the collection of document in Firestore where you chose to store user data. The plugin will fetch data from the document in that collection that has the same ID as the current authenticated user.

Fields

The names of the fields on the user's collection that you which to fetch from the document an use on Bubble.

You can you "dot notation" to dive into the JSON structure of a Map field in a document (e.g. address.street to get the "street" property of the "address" field, if it is a Map type)

Field Types

For each field you choose to fetch from the document, you must specify the type of data Bubble should try to receive.

In some cases, more than one type can be applied, like in boolean values, that you can get as "text" or "yes/no". In other cases you must be careful to declare the right value, or error can occur, like when you try to declare a "number" for a "text" value.


States and Values

The Auth element provides information on the authenticated user. Some are directly linked to the user, but some can be stored on the user's collection at Firestore.

If the user is logged out, those states will be empty, so that is one the ways you can identify if the user is logged in (e.g. Auth's user ID is not empty).

User ID

The ID of the authenticated user, that is also the ID of the same user's document on the users collection at Firestore.

User Email

The email associated to the user's account. It can be empty if the user was created with SMS/phone login through another service, like FlutterFlow, for instance.

User Photo URL

The URL to the profile picture of the user.

User Display Name

The user's display name associated with the account.

Fields (1, 2, 3...)

The fields of the user's collection on Firestore, that you chose to retrieve when you specified them on the Auth element settings.

User Document

This state provides the whole JSON string of the document.

Auth Provider

The type of authentication of the current user.

Can be password, google, facebook or github.

Email Verified

Indicates if the current user has verified his/her account's email.

Created At

The date and time when the user has signed up.

Last Login At

The date and time when the user last logged in to the app.

Access Token

The current user's access token, that can be used to make authenticated calls to REST APIs.

Refresh Token

The current user's refresh token, that can be used to acquire new access tokens.

Data is Ready

Turns to "yes" when all the element's states are done being filled, an "no" when they are being filled.

Although this operations are fast, the fact the they are filled in order and not at the same time may lead to issues, that's why this state was created.


Element Actions

Refresh a Firebase Auth (Current User)

This action will reload the elements data, which can be useful if, for any reason when you updated the user's credentials the profile information contained in the Auth Element is not refreshed automatically.


Events

The Auth element implement a function in the page that listens to any changes on the user's authentication state. This changes will trigger two different kinds of events that can initiate Bubble workflows: "User is logged in" and "User is logged out".

User is logged in

Triggered when the authentication state of the user is changed and the user is logged in.

User is logged out

Triggered when the authentication state of the user is changed and the user is logged out or null. This you also be triggered when a user's account is deleted.

Important! If you use the "User is logged in" and "User is logged out" events to redirect users to another page, while creating an account, it is possible the the events will trigger before the write operations of firestore are completed during sign up. Because of that, it is suggested to use the "Firebase Action Listener" "User signed up" event for this case instead.

Data ready or changed

Triggered when the user data is done loading from the authentication service and from Firestore.

This might be useful if you want to use a do get more fields from the user and the current element didn't have enough slots to do so. It can also be useful to provide document data to a popup filter, reusable element, et cetera, without the need to query the user's document again from Firestore.

Firebase Data Extractor