Skip to content

Cargo features

Choose features on the Git dependency. For SQLite with Rustls and Axum:

alibi = { version = "0.1.1", default-features = false, features = ["axum", "sqlx-sqlite", "rustls"] }
Feature Default Enables
axum no Axum: AxumIntegration, CurrentSession, OptionalSession
poem no Poem: PoemIntegration, session extractors
sqlx yes SQLx store for SQLite and PostgreSQL (sqlx-sqlite + sqlx-postgres)
sqlx-sqlite via sqlx SQLx with SQLite only
sqlx-postgres via sqlx SQLx with PostgreSQL only
seaorm no SeaORM store
redis-cache no RedisAdapter for secondary storage and shared rate limits
native-tls yes OpenSSL for outbound HTTP (OAuth, email verification, CAPTCHA, …) and the SQLx/SeaORM PostgreSQL drivers
rustls no Rustls instead of OpenSSL
  • Pick exactly one TLS feature. The default is native-tls; to use rustls, disable default features.
  • Pick the engine you use. Disabling default features and selecting sqlx-sqlite or sqlx-postgres removes the other engine’s code. SqlxPool::connect returns a configuration error for a URL whose engine is not compiled in.
  • Frameworks are opt-in. Without axum or poem, use BetterAuth::handle_request directly (Other frameworks).
  • SeaORM and SQLx are independent. Enable one or both; each provides its own store, hooks and rate-limit storage.
# PostgreSQL + Axum + Rustls (typical production)
alibi = { version = "0.1.1", default-features = false, features = ["axum", "sqlx-postgres", "rustls"] }
# SeaORM + Poem + Rustls
alibi = { version = "0.1.1", default-features = false, features = ["poem", "seaorm", "rustls"] }
# Axum + SQLx + Redis-backed sessions and rate limits
alibi = { version = "0.1.1", features = ["axum", "redis-cache"] }

Your own sqlx dependency must enable the same engine ("sqlite" and/or "postgres") plus chrono, json and derive, because the generated models derive sqlx::FromRow.