Skip to main content

better_auth_api/
lib.rs

1//! # Better Auth API
2//!
3//! Plugin implementations for the Better Auth authentication framework.
4
5#![cfg_attr(
6    test,
7    allow(
8        unused_results,
9        unreachable_pub,
10        reason = "test code intentionally discards setup return values and exposes helpers broadly"
11    )
12)]
13
14#[cfg(all(feature = "native-tls", feature = "rustls"))]
15compile_error!(
16    "features `native-tls` and `rustls` are mutually exclusive. \
17     Enable exactly one of them: \
18     for `native-tls` (default), remove the `rustls` feature; \
19     for `rustls`, set `default-features = false, features = [\"rustls\"]`."
20);
21
22#[cfg(not(any(feature = "native-tls", feature = "rustls")))]
23compile_error!(
24    "one of the TLS backends must be enabled: \
25     enable either the `native-tls` (default) or `rustls` feature."
26);
27
28pub mod plugins;
29
30pub use plugins::account_management::AccountManagementPlugin;
31pub use plugins::api_key::{ApiKeyConfig, ApiKeyPlugin};
32pub use plugins::device_authorization::DeviceAuthorizationPlugin;
33pub use plugins::email_password::EmailPasswordPlugin;
34pub use plugins::email_verification::EmailVerificationPlugin;
35pub use plugins::oauth::OAuthPlugin;
36pub use plugins::passkey::{PasskeyConfig, PasskeyPlugin};
37pub use plugins::password_management::PasswordManagementPlugin;
38pub use plugins::session_management::SessionManagementPlugin;
39pub use plugins::two_factor::TwoFactorPlugin;