2 releases
0.1.4 | Jun 25, 2023 |
---|---|
0.1.3 | Jun 23, 2023 |
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#1343 in Database interfaces
31 downloads per month
Used in firebase-storage
11KB
68 lines
firebase-app
The Firebase App SDK for Rust provides a Rust API for integrating Firebase services into your Rust applications. This SDK allows you to easily access Firebase features such as authentication, real-time database, storage, and more.
Installation
To use the Firebase App SDK in your Rust project, add the following line to your Cargo.toml
file:
[dependencies]
firebase_app_sdk = "0.1.4" #Latest version at time of writing
Usage
To interact with Firebase services, you need to create an App
instance with the required options. Here's an example:
use firebase_app::{App,DEFAULT,Options};
fn main() {
let options = Options::new("YOUR_APPLICATION_ID", "YOUR_API_KEY")
.with_database_url("YOUR_DATABASE_URL")
.with_storage_bucket("YOUR_STORAGE_BUCKET");
let app = App::new(DEFAULT, options);
}
Once you have created an App instance, you can pass it to other Firebase services for further interactions. Here's an example of using the app instance with the Firebase Authentication service:
use firebase_app::{App,DEFAULT,Options};
use firebase_auth::Authentication;
fn main() {
let options = Options::new("YOUR_APPLICATION_ID", "YOUR_API_KEY").with_auth_domain("YOUR_AUTH_DOMAIN");
let app = App::new(DEFAULT, options);
// Use the app instance with the Firebase Authentication service
let auth = Authentication::new(&app);
// Perform authentication operations using the `auth` instance
}
Please note that the examples provided here are simplified and serve as a starting point. Refer to the documentation of each Firebase service for detailed usage instructions. For comprehensive documentation of the crate, please visit the crate documentation for a better understanding of the crate's functionalities and APIs.
Contributing
Contributions to the Firebase App SDK are welcome! If you encounter any issues or have suggestions for improvements, please submit an issue or pull request on the project's GitHub repository.