[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
  • Login with Microsoft
  • 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.2
Released:  September 8, 2023
Last Updated:  August 4, 2024

2. Blocks

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
SignInWithMicrosoftSign In user with Microsoft Azure Active Directory
customParameters | dictionary
scopes | list
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!

Leave a Comment

Scroll to Top