skillfed

stytch

Stytch python client

stytch v15.3.0 822.6K downloads/30d#4,971 on PyPI67
Permissive license MIT Active released

What it is and what it does

Stytch is a Python client for Stytch's authentication-as-a-service platform. It wraps Stytch's REST API, letting you add passwordless authentication (email magic links, SMS/WhatsApp passcodes, WebAuthn, TOTPs), OAuth integrations, and session management to Python applications. The library supports both B2C (consumer) and B2B (organization-based) authentication flows.

Responses are fully typed using pydantic, so you get IDE autocomplete and runtime validation. Both sync and async methods are available for every endpoint—append `_async` to any method name to use it with asyncio. The library handles structured error responses through StytchError exceptions, letting you catch and respond to specific error types. It requires Python 3.10 or later and depends on aiohttp, requests, pydantic, and pyjwt for HTTP and JWT handling.

Use it for:

  • Add email magic link authentication to a web app without building your own email verification system.
  • Implement B2B multi-tenant organization management with member invitations and SSO.
  • Integrate OAuth logins (Google, GitHub, etc.) alongside passwordless methods in a single client.
  • Build async authentication flows in FastAPI or other async frameworks using the `_async` methods.
  • Handle session validation and token refresh for both consumer and enterprise applications.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python client library for integrating Stytch's authentication and user infrastructure API into applications, supporting email magic links, OAuth, SMS/WhatsApp passcodes, WebAuthn, sessions, and B2B organization management.

Yes. The library is actively maintained, has no known vulnerabilities, installs cleanly with low friction, and uses a permissive MIT license. Install it if you are building on Stytch's platform and need a typed, well-documented Python client for B2C or B2B authentication flows.

Install

stytch on PyPI

pip

pip install stytch

uv

uv add stytch

poetry

poetry add stytch

Installing stytch

Before you install

Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release (51 days old) and ongoing repository activity. Depends on four stable, widely-used libraries: aiohttp, requests, pydantic, and pyjwt.

License in practice

MIT license is permissive; you can use, modify, and distribute this library with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install stytch

import stytch

client = stytch.Client(
    project_id="project-live-...",
    secret="secret-live-...",
)

resp = client.magic_links.email.login_or_create(
    email="user@example.com",
    login_magic_link_url="https://example.com/auth",
    signup_magic_link_url="https://example.com/auth",
)
print(resp)

Requires Python 3.10 or later; you must obtain a Stytch project ID and secret from the Stytch Dashboard.

Verify before relying

  • Whether the async methods work correctly with all endpoint types or if there are known limitations.
  • Performance characteristics when handling high volumes of authentication requests.
  • Whether custom base URL support works reliably across all B2C and B2B endpoints.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 4 — aiohttp, requests, pydantic, pyjwt
Maintenance actively maintained — 51 days since the last release
Last repo commit
First released
Downloads 822,595/month — #4,971 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: stytch-15.3.0-py3-none-any.whl

Keywords: stytch, user, authentication

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

authentication api clientmagic link email authpasswordless login pythonoauth and session managementb2b user infrastructurewebauthn and totp supportstytch api integration
authenticationpasswordlessb2b-saas

More WWW/HTTP packages