> For the complete documentation index, see [llms.txt](https://estare.gitbook.io/firebase-auth-firestore-and-storage-plugin/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://estare.gitbook.io/firebase-auth-firestore-and-storage-plugin/plugin-elements/firebase-action-listener.md).

# Firebase Action Listener

Since most of the actions and logic of the plugin's communication with Firebase happens on the Front-end (the user's browser), Bubble has no way, yet, to wait for a front-end action to finish before another starts.

It also does not allow to return values from front-end operations. That's why those actions return no values to a workflow on Bubble.

To mitigate that, plugin developer often use elements as ways to listen to actions and to trigger events on their completion. That's the goal of the Firebase Action Listener: to inform when an action finishes running (e.g. when a new document creation if confirmed) and allow you do do things before that.

{% hint style="info" %}
This element is crucial for when you need to perform actions in order, like, for instance, when you need to create a document an only then create another, that maybe stores a reference to the one you created earlier.
{% endhint %}

***

## <mark style="color:blue;">Settings</mark>

The Action Listener element has only one setting, the ID you want to define for it. By defining this ID, and providind the same ID on actions, you link them together so that those actino trigger them.

{% hint style="warning" %}
If you leave the ID blank, the elemet will work as a general listener. When you run an action that also has no trigger ID defined, it will trigger all listeners with blank IDs.

So be carefull with ID management for listener. We suggest to always provide one.
{% endhint %}

<div align="left"><figure><img src="/files/dvgcqiRCIlZYfbTvFsSV" alt=""><figcaption></figcaption></figure></div>

***

## <mark style="color:blue;">States and Values</mark>

<div align="left"><figure><img src="/files/Q8caJUZwhaTQPuIMsR4h" alt=""><figcaption></figcaption></figure></div>

### New Document ID

The ID of the last document creation this element was listening for.

### User ID

The ID of a user created or authenticated by a signup or log in action this element was listening for.

### User Email

The Email of a user created or authenticated by a signup or log in action this element was listening for.

### Uploaded File URL

The last file URL generated by an [Upload File Base64](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-storage/upload-file-base64.md) action.

### Updated Document ID

The ID of the last document update action this element was listening for.

### Error Message

If an error occurs, the error message will be stored on this state.

***

## <mark style="color:blue;">Events</mark>

<div align="left"><figure><img src="/files/dkrdHwXIv1o8U1ilEHYv" alt=""><figcaption></figcaption></figure></div>

### Document created

Triggered when the "[create a new document](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firestore/create-a-new-document.md)" actions runs. The ID of the newly created document will be available on the "[new document id](#new-document-id)" state.

### Document updated

Triggered when the "[updated a document](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firestore/update-a-document.md)" actions runs. The ID of the updated document will be available on the "[updated document id](#updated-document-id)" state.

### Document deleted

Triggered when the "[delete a document](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firestore/delete-a-document.md)" actions runs.

### List operation finished

Triggered when list operations like "[update a list of documents](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firestore/update-a-list-of-documents.md)" or "[delete a list of document](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firestore/delete-a-list-of-documents.md)" runs.

### User signed up

Triggers when the "[Sign the User Up](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/sign-the-user-up.md)", "[Log the User in with Google](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-google.md)", "[Log the User in with Facebook](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-facebook.md)" or "[Log the User in with GitHub](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-github.md)" actions create a new user.

### User logged in

Triggers when the "[Log the User In](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in.md)", "[Log the User in with Google](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-google.md)", "[Log the User in with Facebook](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-facebook.md)" or "[Log the User in with GitHub](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-in-with-github.md)" actions start a new session for a user that has previously signed up.

### User logged out

Triggers when the "[Log the User Out](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/log-the-user-out.md)" action finishes running and ends the user's session.

### User updated

Triggers when the any of the updated user functions runs, like change email, password or profile.

### File uploaded

Triggers when the "[Upload file base64](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-storage/upload-file-base64.md)" action completes an upload. It does not trigger on uploads from [Storage Button Uploader](/firebase-auth-firestore-and-storage-plugin/plugin-elements/firebase-storage-upload-button.md) elements.

### File deleted

Triggers when a "[Delete uploaded file](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-storage/delete-uploaded-file.md)" action is completed.

Triggers when the any of the update user functions runs ([Update User's Profile](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/update-users-profile.md), [Password](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/update-users-password.md), [Email](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/update-users-email.md) or [Email verification](/firebase-auth-firestore-and-storage-plugin/plugin-front-end-actions/firebase-auth/send-verification-email/handle-verify-email-code.md)).

### Batch Operation Committed

Triggers when a "[Batch operation commit](#batch-operation-committed)" action is completed.

### Error in action

Triggers if something went wrong in a front-end action, storing the "[error message](#error-in-action)" as a state.
