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
//! # braze
//!
//! Unofficial Rust SDK for Braze APIs.
//!
//! The crate wraps a `progenitor`-generated client (re-exported as
//! [`generated`]) and adds ergonomic auth, error handling, and per-endpoint
//! modules.
//!
//! ## Quick start
//!
//! ```no_run
//! use braze::Client;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::builder()
//! .credentials_file(std::env::var("BRAZE_CREDENTIALS")?)?
//! .build()?;
//! # let _ = client;
//! # Ok(())
//! # }
//! ```
//!
//! See module-level docs for per-API examples: `export`, `messaging`.
//!
//! ## Authentication
//!
//! Braze uses a static REST API key passed as `Authorization: Bearer <key>`.
//! The key and the per-instance `rest_endpoint` come from the Braze dashboard
//! under *Settings → API Keys*. Both can be loaded from a JSON file pointed to
//! by the `BRAZE_CREDENTIALS` environment variable — see
//! [`Credentials::from_file`].
//!
//! ## Cargo features
//!
//! Each API surface is gated behind a feature. None are enabled by default.
//! The generated client in [`generated`] is always compiled in full.
//!
//! - `export` — `/users/export/*` endpoints.
//! - `messaging` — messaging endpoints (`/messages/send`, `/campaigns/trigger/send`, etc.).
//! - `trace` — `#[tracing::instrument]` on public async methods; pulls in `tracing`.
//!
//! ```toml
//! braze = { version = "0.2", features = ["export", "messaging"] }
//! ```
/// Re-export of [`chrono`], which appears in this crate's public API.
///
/// Depend on this re-export rather than adding `chrono` separately, so the
/// version stays in step with the one the SDK was built against.
pub use chrono;
/// Re-export of [`reqwest::header`], whose types appear in this crate's public
/// API ([`Builder::default_headers`] and the `.header()` / `.headers()`
/// methods on every request builder).
///
/// Depend on this re-export rather than adding `reqwest` separately, so the
/// version stays in step with the one the SDK was built against.
pub use header;
/// Re-export of [`secrecy`], whose [`SecretString`](secrecy::SecretString)
/// holds [`Credentials::api_key`].
pub use secrecy;
/// Default Braze REST API surface targeted by this crate.
///
/// Braze does not version its REST API in the URL path, so this constant is
/// informational only — it tracks the version of the upstream documentation
/// the typed wrappers were last reconciled against.
pub const DEFAULT_API_VERSION: &str = "2025-10";
pub use ;
pub use ;
pub use RequestBuilder;
/// Re-export of the raw `progenitor`-generated client.
///
/// Use this when an endpoint isn't yet covered by an ergonomic wrapper.
pub use braze_generated as generated;