--- id: stytch version: "15.3.0" license: MIT license_treatment: permissive maintenance: active --- # stytch — Stytch python client License: permissive · Maintenance: active · Downloads: 822.6K/mo ## 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 above — 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 pip install stytch uv add stytch 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_current - Install friction: low - Maintenance: active - Downloads: 822.6K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags authentication api client, magic link email auth, passwordless login python, oauth and session management, b2b user infrastructure, webauthn and totp support, stytch api integration, authentication, passwordless, b2b-saas [View on SkillFed](https://skillfed.io/packages/stytch) · [View on PyPI](https://pypi.org/project/stytch/)