Skip to main content

firebase_admin/
lib.rs

1//! An open-source Firebase Admin SDK for Rust.
2//!
3//! `firebase-admin` currently implements Firebase **Authentication**:
4//! verifying ID tokens, creating custom tokens, managing users, and
5//! session cookies. Support for additional Firebase services (Firestore,
6//! Cloud Storage, ...) is planned; see `ARCHITECTURE.md` in the repository
7//! root for the project's module and versioning conventions.
8//!
9//! # Example
10//!
11//! ```no_run
12//! # async fn example() -> Result<(), firebase_admin::Error> {
13//! use firebase_admin::auth::AuthClient;
14//!
15//! let auth = AuthClient::builder("my-project-id")
16//!     .service_account_key(firebase_admin::core::ServiceAccountKey::from_file(
17//!         "service-account.json",
18//!     )?)
19//!     .build()?;
20//!
21//! let claims = auth.verify_id_token("<id-token-from-client>").await?;
22//! println!("verified uid: {}", claims.sub);
23//! # Ok(())
24//! # }
25//! ```
26
27#![warn(missing_docs)]
28
29pub mod auth;
30pub mod core;
31mod error;
32
33pub use error::Error;
34
35/// A `Result` alias using [`Error`] as its error type.
36pub type Result<T> = std::result::Result<T, Error>;