Metadata-Version: 2.4
Name: streamlit-firebase-auth
Version: 1.1.6
Summary: Streamlit component for Firebae auth
Project-URL: Homepage, https://github.com/munaita-0/streamlit-firebase-auth
Author-email: Suzuki Shogo <suzuki.shogo@commondo.jp>
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: build>=1.2.2.post1
Requires-Dist: firebase-admin
Requires-Dist: twine>=6.1.0
Description-Content-Type: text/markdown

# streamlit-firebase-auth

**Overview**  
streamlit-firebase-auth is a lightweight Streamlit component library that simplifies integrating Firebase Authentication into your apps. It provides built-in widgets for login and logout functionalities as well as session management utilities, enabling you to quickly add secure, Firebase-powered user authentication to your Streamlit projects.

# Install

```
pip install streamlit-firebase-auth

```

# Quick Use

```python
from streamlit_firebase_auth import FirebaseAuth

auth = FirebaseAuth(
        {
            "apiKey": "YOUR_API_KEY",
            "authDomain": "YOUR_AUTH_DOMAIN",
            "projectId": "YOUR_PROJECT_ID",
            "storageBucket": "YOUR_STORAGE_BUCKET",
            "messagingSenderId": "YOUR_MESSAGING_SENDER_ID",
            "appId": "YOUR_APP_ID",
        })

login_user = auth.check_session()

if login_user:
    auth.logout_form()
else:
    suth.login_form()
```

# API Reference

## auth.login_form()
**Description:**  
Displays a login form to the user and returns the result of the login attempt.

**Return (dict):**  
- `success` (bool): True if login was successful; otherwise, False.  
- `message` (str, optional): An error message if the login failed.

## auth.logout_form()
**Description:**  
Displays a logout interface and performs logout operations (like clearing the session).

**Return (dict):**  
- `success` (bool): True if logout was successful; otherwise, False.  
- `message` (str, optional): An error message if the logout failed.

## auth.check_session()
**Description:**  
Checks the current session to determine if the user is authenticated.

**Return (dict):**  
A dictionary containing the user information provided by Firebase upon successful login.

## auth.signup(email: str, password: str)
**Description:**
Signs up a new user using Firebase Admin.
This function creates a new user account and returns the result of the signup.

**Return (dict):**

- `success` (bool): True if the signup was successful; otherwise, False.
- `message` (str, optional): An error message if the signup failed.

## auth.send_password_reset_email(email: str)
**Description:**
Sends a password reset email to the specified email address.
This function handles the email sending process and returns the result.

**Return (dict):**

- `success` (bool): True if the email was sent successfully; otherwise, False.
- `message` (str, optional): An error message if sending the email failed.

# Detailed Usage

Please refer to the example for detailed usage.

Run :

```shell
streamlit run example/app.py
```

# Image

![Image](https://github.com/user-attachments/assets/b0c6e0ed-c9aa-4785-bd81-92a62040842f)
