Install & Compatibility
Where this runs
tested against v1.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.644s · 53.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.2s · import 1.490s · 53MB
52MB installed
● package 52MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AuthX
✓ from authx import AuthX
✗ from authx.core import AuthX
AuthX is exported at package level, not from core submodule
AuthXConfig
✓ from authx import AuthXConfig
✗ from authx.config import AuthXConfig
Config class is re-exported at package level
Minimal FastAPI app with AuthX JWT authentication
from fastapi import FastAPI, Depends
from authx import AuthX, AuthXConfig
app = FastAPI()
config = AuthXConfig()
config.JWT_SECRET_KEY = "secret"
config.JWT_ACCESS_TOKEN_EXPIRES = 3600
auth = AuthX(config=config)
@app.get("/protected")
def protected(user = Depends(auth.get_current_user)):
return {"user": user}
@app.post("/login")
def login(username: str, password: str):
# Validate credentials (pseudo)
if username == "test" and password == "pass":
token = auth.create_access_token(uid="123")
return {"access_token": token, "token_type": "bearer"}
return {"error": "Invalid credentials"}
Errors
Common errors & fixes
ImportError: cannot import name 'AuthX' from 'authx'
AuthX was renamed from AuthXCore in early versions; or using wrong import path.
fixUse 'from authx import AuthX' (package export). Do not use 'from authx.core import AuthX'.
ModuleNotFoundError: No module named 'authx'
AuthX not installed or installed in wrong environment.
fixRun 'pip install authx' and ensure the environment is active.
AttributeError: 'AuthXConfig' object has no attribute 'JWT_SECRET_KEY'
Trying to set a config attribute before initializing properly or using an outdated config class.
fixCheck version: 'from authx import AuthXConfig'; config = AuthXConfig(); config.JWT_SECRET_KEY = '...'
Upgrade
Version history
1.7.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies
fastapirequiredAuthX is designed for FastAPI applications
pydanticrequiredRequest/response models (v2 only since 1.5.0)