Skip to content

Support passing external session to sync client#310

Merged
logan-stytch merged 1 commit intomainfrom
jlai/sync_client_session
Apr 9, 2026
Merged

Support passing external session to sync client#310
logan-stytch merged 1 commit intomainfrom
jlai/sync_client_session

Conversation

@jlai-stytch
Copy link
Copy Markdown
Contributor

@jlai-stytch jlai-stytch commented Apr 9, 2026

Description

Add support for passing in an external requests.Session to the sync client

The underlying SyncClient supports it already https://github.com/stytchauth/stytch-python/blob/v14.3.0/stytch/core/http/client.py#L40

I assume we don't have to do any cleaning up of the session unlike with the async client, since GC should handle it already if I understand correctly?

Motivation

Customer request - they were having issues with idle connection handling and wanted to have better control over this by passing in custom sessions into the sync client

https://app.plain.com/workspace/w_01HAQ5N757DAG0R7JTXZ4MQYKY/thread/th_01KNSVBGVA90H5G93N0AE3XZZH/

Testing

  • add tests

@jlai-stytch jlai-stytch marked this pull request as ready for review April 9, 2026 19:53
@jlai-stytch jlai-stytch requested a review from a team as a code owner April 9, 2026 19:53
@jlai-stytch
Copy link
Copy Markdown
Contributor Author

Tagging in @logan-stytch as our resident python expert 😅 TY!

@jlai-stytch jlai-stytch force-pushed the jlai/sync_client_session branch from 603b081 to aee16d5 Compare April 9, 2026 20:10
@jlai-stytch jlai-stytch removed the request for review from danny-stytch April 9, 2026 20:10
@logan-stytch logan-stytch merged commit 18e9a47 into main Apr 9, 2026
14 checks passed
@logan-stytch logan-stytch deleted the jlai/sync_client_session branch April 9, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants