Skip to content

Installation

FastAuth requires Python 3.11 or newer and FastAPI.

Install the package

pip install "sreekarnv-fastauth[standard]"

Extras

FastAuth starts with only pydantic[email] and cuid2 installed. Add the extras for the features you use.

Extra What it adds Use when
standard FastAPI, uvicorn, joserfc + cryptography (JWT), SQLAlchemy + aiosqlite, argon2-cffi Default for most apps
oauth httpx Google or GitHub OAuth; also the Webhook email transport
webauthn webauthn Passkeys (WebAuthn)
email aiosmtplib, Jinja2 SMTP email and custom templates
redis redis-py async Redis session backend (OAuth state, passkey challenge store)
postgresql asyncpg PostgreSQL via SQLAlchemy
cli typer, rich The fastauth CLI
all Everything above Trying the full example

Common combinations

pip install "sreekarnv-fastauth[standard,email]"              # credentials + email flows
pip install "sreekarnv-fastauth[standard,oauth,redis]"        # + Google/GitHub OAuth
pip install "sreekarnv-fastauth[standard,webauthn]"           # + passkeys
pip install "sreekarnv-fastauth[all]"                         # everything

Missing extras are detected lazily: when you touch a feature whose dependency is missing, FastAuth raises MissingDependencyError with the exact pip install command. None of the optional imports are evaluated at import time.

Verify the install

fastauth version     # prints: FastAuth v0.5.7
fastauth check       # tabular report of which extras are installed

fastauth itself requires the cli extra (pip install "sreekarnv-fastauth[cli]").

Database support

  • SQLite (dev): included in standard via aiosqlite.
  • PostgreSQL (prod): pip install "sreekarnv-fastauth[standard,postgresql]" and use engine_url="postgresql+asyncpg://...".
  • MySQL: use engine_url="mysql+asyncmy://..." with a compatible async driver (install the driver yourself; FastAuth does not pin one).

See Adapters → SQLAlchemy.

Next

Go to Quickstart.