Crate firebase_app_sdk

source ·
Expand description

Firebase Rust SDK

The Firebase Rust SDK provides a convenient way to interact with Firebase services in Rust applications. This README provides an overview of the SDK and guides you on how to use it effectively.

Usage

To interact with Firebase services, you need to create an App instance with the required options. Here’s an example:

use firebase_app_sdk::{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_sdk::App;
use firebase_app_sdk::Options;
use firebase_auth_sdk::auth::Authentication;
 
const DEFAULT: &str = "DEFAULT";
 
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 above examples are simplified and serve as a starting point. Refer to the documentation of each Firebase service for detailed usage instructions.

Structs

  • Represents an application with its associated options.
  • Represents the configurable options for an application.

Constants

  • Represents a default value or identifier in the context of the Firebase application.