1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! # Firebase Admin SDK for Rust
//!
//! This crate provides a Rust implementation of the Firebase Admin SDK, allowing interaction
//! with Firebase services such as Authentication, Cloud Messaging (FCM), Remote Config, and Firestore.
//!
//! ## Modules
//!
//! - [`auth`]: Firebase Authentication (User management, ID token verification).
//! - [`messaging`]: Firebase Cloud Messaging (Send messages, topic management).
//! - [`remote_config`]: Firebase Remote Config (Get, update, rollback configurations).
//! - [`firestore`]: Cloud Firestore (Read/Write documents).
//! - [`storage`]: Cloud Storage (Upload, download, delete files).
//! - [`crashlytics`]: Firebase Crashlytics (Manage crash reports).
//!
//! ## Usage
//!
//! The entry point is the [`FirebaseApp`] struct. You initialize it with a `ServiceAccountKey`
//! (typically loaded from a JSON file), and then access the various services.
//!
//! ```rust,no_run
//! use firebase_admin_sdk::{FirebaseApp, yup_oauth2};
//!
//! async fn example() {
//! let key = yup_oauth2::read_service_account_key("service-account.json").await.unwrap();
//!
//! let app = FirebaseApp::new(key);
//! let auth = app.auth();
//! let messaging = app.messaging();
//! }
//! ```
// Re-export yup_oauth2 for user convenience so they don't need to add it separately
pub use yup_oauth2;
use FirebaseAuth;
use AuthMiddleware;
use FirebaseCrashlytics;
use FirebaseFirestore;
use FirebaseMessaging;
use FirebaseRemoteConfig;
use FirebaseStorage;
use ServiceAccountKey;
/// The entry point for the Firebase Admin SDK.
///
/// `FirebaseApp` holds the service account credentials and acts as a factory for creating
/// clients for specific Firebase services (Auth, Messaging, etc.).
///
/// It uses a "synchronous constructor, lazy async authentication" pattern.
/// The `new` method is synchronous and cheap, while the actual OAuth2 authentication
/// happens asynchronously and lazily upon the first API request made by any service client.