--- id: supertokens-python version: "0.31.3" license: Apache 2.0 license_treatment: permissive maintenance: active --- # supertokens-python — SuperTokens SDK for Python License: permissive · Maintenance: active · Downloads: 277.2K/mo ## 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 above — 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 pip install supertokens-python uv add supertokens-python poetry add supertokens-python ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 277.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags session management python, authentication sdk python, supertokens integration, user auth api, mfa python library, jwt session handling, passwordless authentication, authentication, session-management, mfa [View on SkillFed](https://skillfed.io/packages/supertokens-python) · [View on PyPI](https://pypi.org/project/supertokens-python/)