skillfed

supertokens-python

SuperTokens SDK for Python

supertokens-python v0.31.3 277.2K downloads/30d#8,151 on PyPI148
Permissive license Apache 2.0 Active released

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-python

uv

uv add supertokens-python

poetry

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 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

Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP :: SessionTopic :: Software Development :: Libraries :: Python Modules

Tags

session management pythonauthentication sdk pythonsupertokens integrationuser auth apimfa python libraryjwt session handlingpasswordless authentication
authenticationsession-managementmfa

More Python Modules packages