Installation
Learn how to install Authkestra in your Rust project.
The easiest way to use Authkestra is via the facade crate with feature flags, allowing you to manage your authentication stack from a single dependency.
Using the Facade Crate
Add authkestra to your Cargo.toml with the features you need:
[dependencies]
# Use the facade with the features you need
authkestra = { version = "0.1.2", features = ["axum", "github"] }
# Async runtime
tokio = { version = "1", features = ["full"] }
# For environment variables
dotenvy = "0.15"Feature Flags
Authkestra uses Cargo features to enable only what you need. This keeps compile times fast and binary sizes small.
Available Features
| Feature | Description |
|---|---|
axum | Axum framework integration with extractors and route helpers |
actix | Actix-web framework integration |
macros | Derive macros (e.g., AuthkestraFromRef) to reduce boilerplate |
github | GitHub OAuth provider |
google | Google OAuth provider |
discord | Discord OAuth provider |
oidc | OpenID Connect support with discovery and validation |
session | Session persistence layer |
token | JWT signing, verification, and offline validation |
guard | Authentication guard and multi-strategy orchestration |
flow | Core authentication flows (OAuth2, PKCE, Device Flow) |
You can combine multiple features:
[dependencies]
authkestra = { version = "0.1.2", features = [
"axum",
"macros",
"github",
"google",
"discord",
"oidc",
"session",
"flow"
] }If you need to enable a specific feature inside one of the sub-crates (e.g., if authkestra-session has a redis feature), you must add the sub-crate directly to your Cargo.toml as well, solely to enable that feature. Cargo will merge the feature flags.
[dependencies]
authkestra = { version = "0.1.2", features = ["session"] }
# Add the sub-crate directly to enable the extra feature
authkestra-session = { version = "0.1.1", features = ["redis"] }Using Individual Crates
For advanced users, individual crates can be used independently:
| Crate | Version |
|---|---|
authkestra-core | 0.1.2 |
authkestra-flow | 0.1.2 |
authkestra-axum | 0.1.2 |
authkestra-actix | 0.1.2 |
authkestra-session | 0.1.2 |
authkestra-token | 0.1.2 |
authkestra-oidc | 0.1.2 |
authkestra-guard | 0.1.0 |
[dependencies]
authkestra-core = "0.1.2"
authkestra-flow = "0.1.2"
authkestra-axum = "0.1.2"
authkestra-providers-github = "0.1.2"
authkestra-session = { version = "0.1.2", features = ["sqlx-store"] }When to use individual crates
Use individual crates when you need fine-grained control over versions, or when implementing custom providers or session stores that don't need the full stack.
Runtime Requirements
Authkestra is async-first and requires a Tokio runtime:
[dependencies]
tokio = { version = "1", features = ["full"] }
# Or minimal features for smaller binaries:
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }Environment Variables
Most examples use dotenvy to load environment variables from
a .env file. Make sure to add it to your dependencies if you're
following along with the examples.
