FirebaseAuthPro: Advanced Firebase Authentication Extension
Version: 1.0.1
Category: Extension
Visibility: Non-Visible
Developer: Idriss
πΉ Overview
FirebaseAuthPro is a **powerful authentication extension** for Kodular, allowing you to easily integrate Firebase Authentication into your app. It provides **sign-in, sign-up, anonymous login, user profile updates, email verification, password reset, account deletion, logout functionality, and offline data storage** for enhanced user management.
β Key Features
- π Sign In & Sign Up: Authenticate users using email and password.
 - π€ Anonymous Sign-In: Allow users to log in without an email/password.
 - π Retrieve User Data: Fetch user info such as email, display name, and photo.
 - βοΈ Email Verification: Send email confirmation links.
 - π Password Reset: Send password reset emails.
 - π§ Profile Management: Update user display name and photo URL.
 - ποΈ Account Deletion: Permanently remove user accounts.
 - π Logout: Clear all stored user credentials.
 - π‘ Offline Mode: Store and retrieve user credentials even when offline.
 
π οΈ Functions & Usage
 Authentication Functions:
- SignIn(email, password) β Logs in a user with email and password.
 - SignUp(email, password) β Registers a new user with email and password.
 - SignInAnonymously() β Allows anonymous sign-in (defaults email to "anonymous").
 
 User Management:
- GetUserData(idToken) β Retrieves user data using an authentication token.
 - UpdateProfile(idToken, displayName, photoUrl) β Updates the user profile.
 - ChangeEmail(idToken, newEmail) β Changes the userβs email.
 - ChangePassword(idToken, newPassword) β Changes the userβs password.
 
 Email & Password Management:
- SendEmailVerification(idToken) β Sends an email verification link.
 - SendPasswordResetEmail(email) β Sends a password reset email.
 - DeleteAccount(idToken) β Deletes the user account permanently.
 
 Logout & Offline Mode:
- Logout() β Clears all stored credentials and logs out the user.
 - GetStoredUserData() β Retrieves stored user credentials as JSON.
 - GetStoredEmail() β Retrieves the stored email.
 - GetStoredIdToken() β Retrieves the authentication token.
 - GetStoredRefreshToken() β Retrieves the refresh token.
 - GetStoredLocalId() β Retrieves the stored user ID.
 - GetStoredExpiresIn() β Retrieves the expiration time of the session.
 
π How It Works (Step-by-Step Guide)
- Step 1: Import the Firebase Authentication Extension (.AIX) into your Kodular project.
 - Step 2: Set your API Key using the 
ApiKeyproperty. - Step 3: Authenticate users using 
SignIn(),SignUp(), orSignInAnonymously(). - Step 4: Retrieve user data with 
GetUserData(idToken). - Step 5: Update profile info using 
UpdateProfile(). - Step 6: Retrieve stored user credentials with 
GetStoredUserData(). - Step 7: Call 
Logout()to clear stored data when the user logs out. 
π‘οΈ Offline Mode & Data Storage
When a user signs in, their credentials are automatically stored. You can retrieve this data anytime, even offline.
To retrieve stored credentials:
GetStoredUserData()
To retrieve a specific data field:
GetStoredEmail()β Get user email.GetStoredIdToken()β Get authentication token.GetStoredLocalId()β Get Firebase user ID.
To clear all stored data and logout:
Logout()
π Events & Error Handling
 Success Events:
- SignInSuccess(localId, email, idToken, refreshToken, expiresIn)
 - SignUpSuccess(localId, email, idToken, refreshToken, expiresIn)
 - AnonymousSignInSuccess(localId, email, idToken, refreshToken, expiresIn)
 
 Error Handling Events:
- SignInError(errorMessage)
 - SignUpError(errorMessage)
 - AnonymousSignInError(errorMessage)
 - GetUserDataError(errorMessage)
 - ChangePasswordError(errorMessage)
 - ChangeEmailError(errorMessage)
 
π οΈ Troubleshooting & Common Issues
β οΈ "Invalid API Key" Error?β Ensure your
ApiKey is correctly set from Firebase.
 "User Not Found" Error?
β The user must be registered before trying to sign in.
 SignInAnonymously() not working?
β Enable Anonymous Sign-In in Firebase Authentication settings.
 Stored Data Not Retrieving?
β Make sure the user has logged in before using GetStoredUserData().
π Why Use This Extension?
β **Fast & Secure Authentication** with Firebase. β **Offline Mode** β Store and access user credentials anytime. β **Complete user management** (Sign in, Sign up, Logout, Update profile). β **Supports Anonymous sign-in** and **email verification**.π47 Blocksπ
π₯ Download & Documentation
π Extension (.AIX):FirebaseAuthPro.aix (27.0 KB)

