Releases: junction-api/junction-python
1.1.0
1.1.0 - 2026-05-07
Added
max_retries— new optional constructor parameter onJunctionandAsyncJunctionthat sets the client-level default retry count (defaults to2); per-requestmax_retriesinrequest_optionsstill takes precedence.
Changed
pydantic-coredependency upper bound widened from<2.44.0to<3.0.0, allowing compatibility with newer pydantic-core releases.- SSE streaming (
iter_sse/aiter_sse) now uses incremental codec decoding and normalizes\r\nand bare\rline endings per the SSE specification, improving reliability with chunked streams.
1.0.0
Changelog
Major release and a migration from tryVital/vital-python@2.1.561
Breaking changes
- Minimum Python is now 3.10 - The new distribution requires Python 3.10 or newer (previously 3.8). Older interpreters can no longer install or import the SDK. Bump your project's runtime, your CI matrix, your Dockerfile base images, and any tooling that pins the interpreter (e.g.
tool.poetry.dependencies.python,setup.cfg python_requires,pyenvfiles). - Package renamed:
vital→junction-api-sdk-
The PyPI distribution name has changed. Uninstall the old package and installjunction-api-sdk, then update every import path in your codebase fromvitaltojunction. This is a replacement, not a version bump — the oldvitaldistribution is no longer published with new releases. - Tighter
pydantic-coreupper bound (<2.44.0) -
The dependency onpydantic-coreis now pinned to>=2.18.2,<2.44.0. If your application or another dependency requirespydantic-core >= 2.44.0, the install will fail to resolve. Audit your lockfile and any sibling packages that pull in newerpydantic-coreversions before upgrading. - Server base URLs replaced (Environment enum also renamed) -
The SDK now talks to the rebranded Junction hosts. The four server URLs have been replaced:api.tryvital.io→api.us.junction.com,api.eu.tryvital.io→api.eu.junction.com,api.sandbox.tryvital.io→api.sandbox.us.junction.com, andapi.sandbox.eu.tryvital.io→api.sandbox.eu.junction.com. This affects any caller that passes a literal URL string for thebase_urlargument or otherwise references the old hosts (allow-lists, monitoring, log filters). The environment enum has also been renamed:VitalEnvironment→JunctionEnvironment. Callers that use the enum (e.g.JunctionEnvironment.PRODUCTION) automatically pick up the new URL because the enum's underlying value changed alongside the rename. - Top-level client class renamed to
Junction/AsyncJunction-
The synchronous and asynchronous client classes have been renamed.Vitalis nowJunction, andAsyncVitalis nowAsyncJunction. Update every construction site and every type annotation that references the old names. The constructor keyword arguments (api_key,base_url,environment,timeout,httpx_client, …) are unchanged. - Request bodies and path parameters are now inline keyword arguments -
Methods that used to take a singlerequest=<RequestModel>object alongside path parameters now expose every body field and path parameter directly on the method signature. Construct the call by passing each field as a keyword argument (or, for path parameters, as a positional argument) instead of building a request model. The change applies uniformly across the SDK — for examplelab_tests.book_phlebotomy_appointment(order_id, request=AppointmentBookingRequest(booking_key=...))becomeslab_tests.book_phlebotomy_appointment(order_id, booking_key=...). Required body fields become required keyword arguments; optional body fields become optional keyword arguments with the same names. - Some response and request fields are now
Optional-
Fields whose schemas are marked nullable in the API definition are now exposed asOptional[...]in Python types and may legitimately beNone. If you have type-checked code that previously relied on these fields being non-None, add a guard (or update your type hints) before dereferencing them. This affects both response model attributes and the corresponding request inputs; the wire format is unchanged.
New & improved
-
New top-level resources
The SDK now exposes thecompendium,lab_account,order_transactionresource clients on the root client. See the API reference for the full endpoint list. -
Raw response shapes formalized —
*V2InDbtypes are now*Raw
Endpoints whose responses were previously typed as*V2InDbnow use*Rawtypes. The values are unchanged; only the type names differ:ActivityV2InDb→ActivityRaw(foractivity.get_raw)BodyV2InDb→BodyRaw(forbody.get_raw)DeviceV2InDb→DevicesRaw(fordevices.get_raw)SleepV2InDb→SleepRaw(forsleep.get_raw)WorkoutV2InDb→WorkoutRaw(forworkouts.get_raw)
Additionally, the standalone
RawDeviceswrapper from the old SDK is replaced byRawDevicesResponse.If you imported one of the old type names directly (e.g.
from junction.types.activity_v_2_in_db import ActivityV2InDb), switch to the newRawtype. -
Configurable SDK logging
BothJunctionandAsyncJunctionaccept a newloggingkeyword argument (LogConfigor a customLogger). Pass aLogConfigto set the log level (debug/info/warn/error) and toggle silent mode, or supply your ownLoggerimplementation to integrate with an existing application logger. By default the SDK is silent. -
Optional
aiohttpasync transport
An opt-inaiohttpextra is available:pip install "junction-api-sdk[aiohttp]". Installing it pulls inaiohttpandhttpx-aiohttp, and lets you passhttpx_client=DefaultAioHttpClient(...)fromjunction._default_clientsto the async client to use an aiohttp-backed transport. Existing users do not need to install the extra.
Removed
-
Legacy link methods removed -
These six methods have been deprecated for over two years and were never part of the documented Junction Link integration path; they should not have been in the SDK in the first place. They are removed in this release:email_authpassword_authstart_connectconnect_manual_providertoken_stateis_token_valid
If you have call sites referencing these methods, see the Junction Link API reference for the documented integration path. The supporting request/body classes that backed them are also removed.
The supporting request/body classes that backed these methods are also removed:
BeginLinkTokenRequest,EmailAuthLink,PasswordAuthLink,LinkTokenValidationRequest,ManualConnectionData. -
team.get_link_configremoved -
team.TeamClient.get_link_configand its async/raw counterparts have been removed. The endpoint it wrapped (GET /v2/team/link/config) was previously deprecated. Read team-level link configuration through the team configuration surface (see the API reference for the current shape) or rely on the configuration values you pass when issuing link tokens vialink.token(...). -
Public types removed -
Three top-level type re-exports were removed from the SDK with no equivalent. If you imported any of these from the package root, drop the import:AuthType— was used by the legacyemail_authflow only.ManualProviders— was the parameter type for the now-removedconnectManualProvidermethod (one of the legacy link methods, see above). With that method gone, this enum is removed too.ClientFacingUserKey— the endpoint that used to return this model now returnsClientFacingUserinstead. If you depended on the user-key shape, switch to reading the user fields offClientFacingUserdirectly.