Install and run the memory example:
uv add authkit
uv run uvicorn examples.minimal.main:app --reloadThe integration surface is intentionally small:
backend = MemoryBackend()
auth = AuthKit(
AuthKitConfig(
secret_key="replace-with-at-least-32-random-bytes",
require_email_verification=False,
),
backend=backend,
)
app.include_router(auth.router, prefix="/auth")Try the lifecycle through /docs:
POST /auth/registerwith email and password.POST /auth/login; copyaccess_tokeninto Swagger's Authorize dialog.- Call an endpoint using
Depends(auth.current_user). POST /auth/refreshwith the refresh token. The old token is consumed.POST /auth/logoutwith the current bearer and refresh token.
For durable state, install authkit[postgres], create a
SQLAlchemyBackend, and run authkit db upgrade before starting the app.