[FREE] FSA: Combined features of Firebase Storage and Authentication 🔥

1. Introduction

Description: This extension uses latest Firebase Storage SDK [20.2.1] and Firebase Auth SDK [22.2.0] to integrate its features in your app. You can easily do these operations:

  • upload file
  • download file
  • list files
  • delete file
  • get metadata of files

…. and all basic authentication features which includes

  • Sign up with email & password
  • Login with email & password
  • Login with Google
  • Sign In with Phone Number
  • Get User info
  • Update User info (Profile, Email, Password)
  • Verify Email address with link
  • Send password reset link on email
  • Get Id Token
  • Delete user

Latest Version: 3.1
Released:  September 8, 2023
Last Updated:  November 9, 2023

2. Blocks

image image image image
image
image image

3. Docs

UploadFailedEvent raised when uploading fails
file | text
errorMsg | text
UploadProgressEvent raised when upload progress changes
file | text
bytesTransferred | number
totalBytes | number
FileUploadedEvent raised after file has been uploaded
file | text
fileName | text
downloadUrl | text
GotMetadataEvent raised after getting metadata. If any error occurred then dictionary will have single key named ‘errorMsg’.
metadataDict | dictionary
DownloadSuccessfulEvent indicating file has been downloaded
fileName | text
outputPath | text
DownloadFailedEvent indicating file downloading has failed
fileName | text
errorMsg | text
GotFilesListEvent raised after getting files list
list | list
FileDeletedEvent raised after getting delete response. If successful then response will be empty, otherwise error msg.
successful | boolean
response | text
GetUserInfoFailedEvent raised if some error occurred while getting user info
GotUserInfoEvent raised after getting user info
provider | text
userId | text
name | text
email | text
profilePicture | text
phoneNumber | text
GotIdTokenEvent raised after getting Id Token of current user
token | text
SignUpSuccessfulEvent raised if sign up was successful
provider | text
userId | text
name | text
email | text
profilePicture | text
phoneNumber | text
SignUpFailedEvent raised if sign up failed
errorMsg | text
LoginSuccessfulEvent raised if login was successful and provides user info
provider | text
userId | text
name | text
email | text
profilePicture | text
phoneNumber | text
LoginFailedEvent raised when login failed
provider | text
errorMsg | text
UserUpdateFailedEvent raised when some error occurred while updating user
type | text
errorMsg | text
UserUpdateSuccessEvent raised when user info was successfully updated
type | text
UserDeletedResultEvent raised after getting DeleteUser result
successful | boolean
OtpSentEvent raised when OTP has been sent
InitInitializes firebase storage with provided credentials
projectId | text
apiKey | text
storageBucket | text
appId | text
oauthKey | text
UploadUploads file from given path/uri
filePath | text
fileName | text
BucketNameReturns storage bucket name
GetMetadataTries to get metadata of file
fileName | text
DownloadTries to download specified file to output path/uri. If providing Uri as output then make sure to create the file first with SAF. If path provided then file will be created if it doesn’t exixt.
fileName | text
outputPath | text
ListFilesGets a list of files in specified folder. For root folder provide ‘/’ as argument.
folder | text
DeleteDelets specified file
fileName | text
PauseDownloadsPause all active downloads
ResumeDownloadsResume all download tasks
PauseUploadsPause all upload tasks
SignUpWithEmailSign up with email and password
email | text
password | text
IsSignedInReturn whether there is an active user or not
GetUserInfoTries to get user info of currently signed user
GetIdTokenTries to get id token
LoginWithEmailLogin user with email and password
email | text
password | text
LoginWithGoogleLogin the user with Google
SignOutSign out the currently signed user
UpdateEmailUpdate the email address of current user
email | text
UpdateProfileUpdate display name and profile picture of current user
displayName | text
photoUrl | text
VerifyEmailSend email for verification
SendPasswordResetEmailSends password reset email
UpdatePasswordUpdates the password of currently signed user
newPassword | text
DeleteUserDeletes currently signed user
SignInWithPhoneSign in user with Phone Number
phoneNumber | text
VerifyPhoneNumberVerify OTP to sign in with Phone Number
otp | text

4. Usages

Init
image

You can easily find these credentials in google-services.json file which you get after adding your app to Firebase project and adding Auth + Storage features.

Upload
image

Image will be uploaded in test subfolder. Use / as prefix (eg. /sample.jpg) to upload files into root folder.

List Files, Get Metadata and Download

metadata dictionary keys

  • downloadUrl
  • contentDisposition
  • contentEncoding
  • contentType
  • timeCreated
  • updated
  • size

Values may contain \ , make sure to remove it

Authentication blocks are self explanatory. So I’ll add blocks for that later if needed.

5. Downloads

Licensed under creativecommons.org/licenses/by-sa/4.0
An attribution and link to sunnythedeveloper.in is must

6. Support Me

Your support will really motivate me to create more such extensions.

Thank you.

Hope it helps!

Subscribe
Notify of
guest
17 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Silktune
Silktune
8 months ago

Can it working on Android builder

MasiZ
MasiZ
Reply to  Silktune
4 months ago

Tell me where to find “oauthkey” for initialization? I seem to have looked through everything, but I still haven’t found it.

Walter
Walter
7 months ago

Hi Sunny, how can i get the authKey for the Init. block?

Rafael
Rafael
7 months ago

SignOut method crashes apps (tested in Niotron and Mit App)

AMARILDO CORREA DE SOUZA
AMARILDO CORREA DE SOUZA
7 months ago

Could you post the correct blocks and steps for the auth phone number, please!

Om Nirmalkar
Om Nirmalkar
5 months ago

Firebase Storage component is not present.

Om Nirmalkar
Om Nirmalkar
Reply to  Om Nirmalkar
5 months ago

i am not able to use it

Valter
Valter
1 month ago

I’m trying to download several “.pdf” files from Storage Firebase, but when I put this path “/storage/emulated/0/Download/PartiturasSAX/” in “Outputpath” the files are downloaded, overlapping each other, and finally, Only the last file remains in the “/storage/emulated/0/Download/” folder, but with the name “PartiturasSAX” and without the “.pdf”.

And in fact, it was supposed to create the folder “PartiturasSAX” Inside “Download” and download all the files in it

Valter
Valter
Reply to  Sunny Gupta
1 month ago

comment image