supertokens-python
SuperTokens SDK for Python
What it is and what it does
SuperTokens Python SDK is a client library that connects your Python API to the SuperTokens authentication backend service. It provides session management, user authentication flows, and multi-factor authentication capabilities by delegating authentication logic to a separate SuperTokens core service. The SDK handles token generation, validation, and session lifecycle management, and integrates with common Python web frameworks.
You install it alongside your API code, configure it with your SuperTokens service endpoint and application details, and then use its recipes and middleware to protect routes and manage user sessions. It depends on cryptographic libraries (pycryptodome, PyJWT), email delivery (aiosmtplib, twilio), phone number handling (phonenumbers), and standard utilities like pydantic and httpx for HTTP communication.
Use it for:
- Add session-based authentication to a Python web application without building auth from scratch.
- Implement passwordless login flows in a Python API using SuperTokens as the auth backend.
- Manage multi-factor authentication for user accounts in a Python web service.
- Centralize session and token management across multiple Python microservices via a shared SuperTokens core.
- Integrate phone verification and SMS delivery into user signup or account recovery workflows.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Interfaces a Python API with the SuperTokens authentication service to add session management, user authentication, and multi-factor authentication to web applications.
Yes, if you are building a Python web application and want to outsource authentication to SuperTokens. The SDK is actively maintained, has low install friction, uses a permissive license, and integrates with popular frameworks. Install it only if you have a SuperTokens core service running or plan to use SuperTokens' managed offering; the SDK alone cannot authenticate users without that backend.
Install
supertokens-python on PyPI
pip
pip install supertokens-pythonuv
uv add supertokens-pythonpoetry
poetry add supertokens-pythonInstalling supertokens-python
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent commit on 2026-07-24 and a release 100 days ago. Depends on 16 runtime packages including cryptographic and email libraries; all are standard ecosystem choices.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions—suitable for most production and proprietary projects.
Quickstart
pip install supertokens-python
from supertokens_python import init, InputAppInfo
init(
app_info=InputAppInfo(
app_name="MyApp",
api_domain="http://localhost:api",
website_domain="http://localhost:web"
),
framework="flask",
recipe_list=[...]
)
Requires a running SuperTokens core service accessible at the configured api_domain; the SDK acts as a client to that service.
Verify before relying
- Exact supported framework integrations (Flask, FastAPI, Django, etc.) and their configuration requirements.
- Whether token refresh, revocation, and session expiry are handled automatically or require explicit code.
- Performance characteristics under high concurrency or with many simultaneous sessions.
- Specific MFA methods supported (TOTP, SMS, email) and their setup requirements.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 16 — Deprecated, PyJWT, aiosmtplib, asgiref, httpx, packaging, phonenumbers, pkce, pycryptodome, pydantic, pyotp, python-dateutil, sniffio, tldextract, twilio, typing_extensions |
| Maintenance | actively maintained — 100 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 277,237/month — #8,151 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: supertokens_python-0.31.3-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
supabase-authA Python client library for Supabase Auth that…
permissive · top 1,000 on PyPI
dj-rest-authProvides drop-in REST API endpoints for user…
permissive · top 5,000 on PyPI
Flask-SecurityFlask-Security adds authentication,…
permissive · top 15,000 on PyPI
drf-jwtAdds JSON Web Token (JWT) authentication to…
permissive · top 15,000 on PyPI
duo-clientPython client library for Duo Security's…
permissive · top 15,000 on PyPI
djangorestframework-jwtAdds JSON Web Token (JWT) authentication…
permissive · top 15,000 on PyPI
gotruePython client library for Supabase Auth that…
permissive · top 5,000 on PyPI
djangorestframework-simplejwtProvides JSON Web Token (JWT) authentication…
permissive · top 5,000 on PyPI
Flask-Security-TooAdds user authentication, authorization, and…
permissive · top 15,000 on PyPI
boxsdkProvides a Python client library for…
permissive · top 5,000 on PyPI