| Crates.io | firebase-rust-sdk |
| lib.rs | firebase-rust-sdk |
| version | 0.1.0-beta |
| created_at | 2025-12-16 10:02:30.24275+00 |
| updated_at | 2025-12-17 10:18:00.505126+00 |
| description | Unofficial Rust port of Firebase C++ SDK |
| homepage | https://github.com/cwahn/firebase-rust-sdk |
| repository | https://github.com/cwahn/firebase-rust-sdk |
| max_upload_size | |
| id | 1987467 |
| size | 428,454 |
Idiomatic Rust SDK for Firebase Authentication and Cloud Firestore with full async/await support and gRPC transport.
⚠️ Unofficial Port: This is an unofficial community port of the Firebase C++ SDK. It is not affiliated with, endorsed by, or supported by Google or Firebase.
⚠️ Beta Release: This is version 0.1.0-beta. APIs are stabilizing but may still change before 1.0.0. Suitable for development and testing.
Add to your Cargo.toml:
[dependencies]
firebase-rust-sdk = "0.1.0-beta"
tokio = { version = "1", features = ["full"] }
See the documentation for detailed API reference.
use firebase_rust_sdk::{App, AppOptions, Auth, firestore::Firestore};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize Firebase App
let app = App::create(AppOptions {
api_key: "YOUR_API_KEY".to_string(),
project_id: "your-project-id".to_string(),
app_name: None,
}).await?;
// Get Auth instance
let auth = Auth::get_auth(&app).await?;
// Sign in
auth.sign_in_with_email_and_password("user@example.com", "password").await?;
let user = auth.current_user().await?;
println!("Signed in as: {}", user.uid);
// Get Firestore instance with ID token
let id_token = user.get_id_token(false).await?;
let firestore = Firestore::new(
app.options.project_id.clone(),
"default".to_string(),
Some(id_token)
).await?;
// Write document
let doc_ref = firestore.document("users/alice");
doc_ref.set(/* your data */).await?;
// Read document
let snapshot = doc_ref.get().await?;
if snapshot.exists() {
println!("Data: {:?}", snapshot.data);
}
Ok(())
}
This SDK is in active development. Core functionality is complete, but some features are pending:
The SDK includes 24 comprehensive integration tests. To run them:
.env.example to .envcargo test --test firestore_integration -- --test-threads=1Contributions welcome! This project follows the design patterns from the Firebase C++ SDK while using idiomatic Rust patterns.
MIT License - see LICENSE file for details.
Based on the Firebase C++ SDK architecture. This is an independent implementation and is not officially supported by Google or Firebase.