Skip to Content

Change log

Notable changes to the Improve SDK packages, including breaking changes and how to upgrade.

2 min read

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, one changelog per package.

Core SDK (@obelism/improve-sdk)

2.0.0

  • 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

  • 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

0.4.0

  • Reliability, security and performance improvements.

0.3.x

  • 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)

1.0.0

  • 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

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

0.4.0

  • Added the useImproveStatus hook for reading the provider lifecycle (loading / setup / error).

On this page

Marks in the margin

  • Note
  • Watch out
  • Updated

Scribes marked doubtful lines in the margin. That practice is called obelism.