# Change log (/docs/change-log)

Notable changes to the Improve SDK packages (`@obelism/improve-sdk`, `@obelism/improve-sdk-react`, `@obelism/improve-sdk-next`). Full release notes live in the [SDK repository](https://github.com/Obelism/sdk/blob/main/packages/improve/CHANGELOG.md), one changelog per package.

## Core SDK (`@obelism/improve-sdk`) [#core-sdk-obelismimprove-sdk]

### 2.0.0 [#200]

- **Breaking:** analytics are decoupled from tests. Events are now **test-independent** and attribution happens server-side by joining a visitor's **exposures** against the event stream.
  - `postAnalytic` dropped its leading `testSlug` argument: `postAnalytic(event, payload?)`. An event is recorded once per visitor per page/session, independent of any test.
  - **Exposures are automatic.** `getTestValue` / `getFlagValue` now emit an exposure beacon the first time they resolve a non-holdout variant for a visitor. A visitor must read a test/flag's variant for their subsequent events to be attributed to it; audience-excluded and holdout visitors are never exposed. The old implicit "first tracked event = exposure" behaviour is gone.
  - `POST /api/log` bodies are now discriminated by a `type: 'event' | 'exposure'` field, and event bodies no longer carry `testId`/`testValue`. This is a hard cutover: old beacons are rejected.
  - The GTM `dataLayer` `improve` block no longer contains `test` / `variant`, only `visitorId`. Compare variants in the test Monitor, not via a GTM/Google Ads split.

### 1.0.0 [#100]

- **Breaking:** requires `ua-parser-js` **v2** as a peer dependency (was v1). The SDK now uses the named `{ UAParser }` export. Run `npm i ua-parser-js@^2` when upgrading.

### 0.5.0 [#050]

- Added [Google Tag Manager / Google Ads `dataLayer` integration](/docs/integrations/gtm). `postAnalytic` now mirrors each event onto `window.dataLayer` with experiment dimensions. Enabled by default; opt out with `dataLayer: false`.

### 0.4.0 [#040]

- Reliability, security and performance improvements.

### 0.3.x [#03x]

- `0.3.2`: Exposed `organizationId`, `environment` and `state` properties; `fetchConfig` now returns the loaded config.
- `0.3.1`: Added the `baseUrl` setup arg (point the SDK at your Improve instance).
- `0.3.0`: Server API authentication via the `token` setup arg.

## React & Next SDKs (`@obelism/improve-sdk-react`, `@obelism/improve-sdk-next`) [#react--next-sdks-obelismimprove-sdk-react-obelismimprove-sdk-next]

### 1.0.0 [#100-1]

- **Breaking:** tracks the core SDK `2.0.0` line. `usePostAnalytic()` now takes **no arguments** and returns a global post function `(event, payload?) => …`; it is no longer bound to a test slug. Reading a variant with `useTestValue` / `useFlagValue` records the exposure that events are attributed to.

### 0.5.x [#05x]

- Reliability, security and performance improvements; track the core SDK `1.0.0` line.

### 0.4.0 [#040-1]

- Added the [`useImproveStatus`](/docs/sdk/react#useimprovestatus) hook for reading the provider lifecycle (`loading` / `setup` / `error`).
