{"id":31626317,"url":"https://github.com/better-auth-rs/better-auth-rs","last_synced_at":"2026-01-31T09:06:23.147Z","repository":{"id":306411559,"uuid":"1025914945","full_name":"better-auth-rs/better-auth-rs","owner":"better-auth-rs","description":"🦀 Rust backend implementation of @better-auth.","archived":false,"fork":false,"pushed_at":"2025-09-26T21:59:19.000Z","size":200,"stargazers_count":39,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-21T00:20:32.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://better-auth.rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/better-auth-rs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-25T02:52:37.000Z","updated_at":"2026-01-18T22:11:08.000Z","dependencies_parsed_at":"2025-07-25T15:52:19.747Z","dependency_job_id":"70ff25bc-906e-44fe-a9bc-d062f273bead","html_url":"https://github.com/better-auth-rs/better-auth-rs","commit_stats":null,"previous_names":["aprilnea/better-auth-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/better-auth-rs/better-auth-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better-auth-rs%2Fbetter-auth-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better-auth-rs%2Fbetter-auth-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better-auth-rs%2Fbetter-auth-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better-auth-rs%2Fbetter-auth-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/better-auth-rs","download_url":"https://codeload.github.com/better-auth-rs/better-auth-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/better-auth-rs%2Fbetter-auth-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28936100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T08:53:31.997Z","status":"ssl_error","status_checked_at":"2026-01-31T08:51:38.521Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T19:44:20.760Z","updated_at":"2026-01-31T09:06:23.142Z","avatar_url":"https://github.com/better-auth-rs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Better Auth RS\n\nThe most comprehensive authentication framework for Rust. Inspired by [Better Auth](https://www.better-auth.com/).\n\n[![Crates.io](https://img.shields.io/crates/v/better-auth.svg)](https://crates.io/crates/better-auth)\n[![Documentation](https://docs.rs/better-auth/badge.svg)](https://docs.rs/better-auth)\n[![CI](https://github.com/better-auth-rs/better-auth-rs/actions/workflows/ci.yml/badge.svg)](https://github.com/better-auth-rs/better-auth-rs/actions/workflows/ci.yml)\n[![License](https://img.shields.io/crates/l/better-auth.svg)](LICENSE-MIT)\n\n## Features\n\n- **Plugin Architecture** - Extend and customize authentication flows\n- **Type Safety** - Leverages Rust's type system for compile-time guarantees\n- **Async First** - Built on Tokio with full async/await support\n- **Database Agnostic** - Support for multiple databases through adapter pattern\n- **Web Framework Integration** - First-class Axum support\n- **OpenAPI** - Built-in OpenAPI spec generation\n- **Middleware** - CSRF, CORS, rate limiting, body size limits\n\n## Quick Start\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nbetter-auth = \"0.1\"\n```\n\n```rust\nuse better_auth::{BetterAuth, AuthConfig};\nuse better_auth::plugins::EmailPasswordPlugin;\nuse better_auth::adapters::MemoryDatabaseAdapter;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let config = AuthConfig::new(\"your-very-secure-secret-key-at-least-32-chars-long\")\n        .base_url(\"http://localhost:3000\")\n        .password_min_length(8);\n\n    let auth = BetterAuth::new(config)\n        .database(MemoryDatabaseAdapter::new())\n        .plugin(EmailPasswordPlugin::new().enable_signup(true))\n        .build()\n        .await?;\n\n    println!(\"Authentication system ready!\");\n    println!(\"Registered plugins: {:?}\", auth.plugin_names());\n\n    Ok(())\n}\n```\n\n### Axum Integration\n\nEnable the `axum` feature:\n\n```toml\n[dependencies]\nbetter-auth = { version = \"0.1\", features = [\"axum\"] }\n```\n\n```rust\nuse better_auth::{BetterAuth, AuthConfig};\nuse better_auth::plugins::EmailPasswordPlugin;\nuse better_auth::adapters::MemoryDatabaseAdapter;\nuse better_auth::handlers::AxumIntegration;\nuse std::sync::Arc;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let config = AuthConfig::new(\"your-secret-key\");\n\n    let auth = Arc::new(\n        BetterAuth::new(config)\n            .database(MemoryDatabaseAdapter::new())\n            .plugin(EmailPasswordPlugin::new())\n            .build()\n            .await?\n    );\n\n    let app = auth.axum_router();\n\n    let listener = tokio::net::TcpListener::bind(\"0.0.0.0:3000\").await?;\n    axum::serve(listener, app).await?;\n\n    Ok(())\n}\n```\n\n## Crate Structure\n\n| Crate | Description |\n|-------|-------------|\n| [`better-auth`](https://crates.io/crates/better-auth) | Main crate, re-exports and Axum integration |\n| [`better-auth-core`](https://crates.io/crates/better-auth-core) | Core abstractions: traits, config, middleware, error handling |\n| [`better-auth-api`](https://crates.io/crates/better-auth-api) | Plugin implementations (email/password, session management, etc.) |\n| [`better-auth-entity`](https://crates.io/crates/better-auth-entity) | Entity definitions (User, Session, Account) |\n\n## Plugins\n\n| Plugin | Status | Description |\n|--------|--------|-------------|\n| Email/Password | Done | Sign up/sign in with email \u0026 password, username support |\n| Password Management | Done | Password reset, change, set |\n| Email Verification | Done | Email verification workflows |\n| Session Management | Done | Session listing and revocation |\n| Account Management | Done | Account linking and unlinking |\n| OAuth | Planned | Social sign-in (OAuth 2.0) |\n| Two-Factor Auth | Planned | TOTP, backup codes |\n\n## API Endpoints\n\nEndpoints are registered by plugins:\n\n```\nPOST /sign-up/email          # User registration\nPOST /sign-in/email          # Email-based login\nPOST /sign-in/username       # Username-based login\nPOST /forget-password        # Password reset request\nPOST /reset-password         # Password reset confirmation\nPOST /change-password        # Change password (authenticated)\nPOST /set-password           # Set password (authenticated)\nPOST /send-verification-email\nPOST /verify-email\nGET  /sessions               # List active sessions\nPOST /revoke-session         # Revoke a session\nGET  /accounts               # List linked accounts\nPOST /unlink-account         # Unlink an account\n```\n\n## Database Adapters\n\n- **MemoryDatabaseAdapter** - In-memory storage for development and testing\n- **SqlxAdapter** - PostgreSQL with connection pooling and migrations (`sqlx-postgres` feature)\n\n## Feature Flags\n\n```toml\n[features]\naxum = []           # Axum web framework integration\nsqlx-postgres = []  # PostgreSQL database support\nredis-cache = []    # Redis caching (planned)\n```\n\n## Examples\n\n```bash\n# Basic usage (in-memory)\ncargo run --example basic_usage\n\n# PostgreSQL\nexport DATABASE_URL=\"postgresql://user:pass@localhost:5432/better_auth\"\ncargo run --example postgres_usage --features sqlx-postgres\n\n# Axum web server with interactive demo\ncargo run --example axum_server --features axum\n```\n\n## License\n\nLicensed under either of:\n\n- [MIT License](LICENSE-MIT)\n- [Apache License, Version 2.0](LICENSE-APACHE)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetter-auth-rs%2Fbetter-auth-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbetter-auth-rs%2Fbetter-auth-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbetter-auth-rs%2Fbetter-auth-rs/lists"}