pypi stytch 6.0.0
v6.0.0 [yanked]

latest releases: 13.21.0, 13.20.1, 13.20.0...
2 years ago

WARNING: This version was yanked due to a missing requirement. Please upgrade to v6.0.1.

New features

  • Async support!
    • Every method now has an equivalent *_async variant
  • Typed responses
    • Every method will return a typed object from pydantic instead of raw JSON response
    • For example, client.users.get(…) would return a stytch.models.users.GetResponse
      • The sync and async APIs return the same *Response models, so the same is true for await client.users.get_async(...)
  • Better error handling
    • Responses are still thrown as StytchError (you should always use a try/except block when calling the API)
    • In addition, any bad response from the API (including server 500 errors) are now also packaged into a StytchError
      • No more special handling of requests.JSONDecodeError

Breaking changes

This is a major update to the stytch-python library, so you should carefully check all existing callsites for compatibility. There are two major breaking changes:

  1. Responses are now typed, so instead of resp["user_id"], you may use something like resp.user_id
  2. Name and SearchQuery are typed objects now and should be used with relevant API endpoints instead of manually constructing mixed-type Dict[str, Any] objects
  3. The minimum supported Python version has been updated to 3.7

Upgrade guide

  1. When upgrading from 5.X to 6.0, you should check all callsites and ensure you're using the typed response objects instead of the old-style version that relies on indexing into untyped JSON
  2. If you are using any endpoint with Name or SearchQuery parameters, upgrade those to instead use the typed models from stytch.core.models

Don't miss a new stytch release

NewReleases is sending notifications on new releases.