# Changelog

Release history of the medblocks SDK, newest first.

{/* GENERATED FROM sdk/connect/CHANGELOG.md - do not edit here. */}

## v1.2.0 (Aug 4, 2026) [#v120-aug-4-2026]

### Breaking Changes [#breaking-changes]

* Removed the eight typed error subclasses (`MedblocksAuthenticationError`,
  `MedblocksPermissionError`, `MedblocksInvalidRequestError`,
  `MedblocksNotFoundError`, `MedblocksConflictError`, `MedblocksRateLimitError`,
  `MedblocksEhrError`, `MedblocksApiError`) and the `errorClassForType` helper.
  Every failed request now throws a single `MedblocksError`. Discriminate on
  `err.type` and `err.code`, the same strings the API envelope returns. Replace
  `err instanceof MedblocksAuthenticationError` with
  `isMedblocksError(err) && err.type === "authentication_error"`.
* `retryAfter` moved from `MedblocksRateLimitError` onto the base
  `MedblocksError` (set on `rate_limit_error`, `null` otherwise).
* Removed `mb.patients.getConnections(patientId)`. Read connections from
  `mb.patients.retrieve(id).connections[]` instead. The full `facility`
  object is inlined per entry, so migrate callsites from
  `facilities.map((facility) => facility.name)` to
  `patient.connections.map((connection) => connection.facility.name)`.

### Features [#features]

* Added the `isMedblocksError(err)` type guard for separating API errors from
  native or network failures at the catch site.
* Added the `MedblocksErrorCode` string-literal type and extended
  `MedblocksErrorType` with `billing_error`, so `err.type` / `err.code` branches
  autocomplete against the full public taxonomy.

## v1.1.0 (Jul 18, 2026) [#v110-jul-18-2026]

### Features [#features-1]

* Added `mb.patients.disconnectConnection(patientId, connectionId)` for org-side
  disconnect of a patient connection. Revokes your organization’s access to that
  source and returns a tombstone
  (`{ id, resource_type: "connection", disconnected: true }`).

## v1.0.0 (Jul 8, 2026) [#v100-jul-8-2026]

### Features [#features-2]

* Initial release of the Medblocks TypeScript SDK, covering patient sessions,
  patients, the connections catalog, webhook management, event redelivery,
  webhook signature verification, and return-URL parsing.
* `mb.patients.records(id)` returns a connected patient’s stored FHIR resources
  as a cursor-paginated page. Every Patient resource carries your `patient_id`
  in its FHIR `identifier` array under `urn:medblocks:patient-id`.
* Record pages use short, fixed-length opaque cursors that stay valid for 7 days
  from the response that issued them.

## Need help?

Running into an issue or have a question the docs do not answer? Get support from the Medblocks team through https://forms.gle/dtVxkmfL6Yimp6SBA and we will get back to you.
