> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.libratech.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Changelog

> Every @libra/sdk release, newest first

Versions follow the npm package. **Breaking changes** are tagged; migrate before upgrading. The same version is published to WK Artifactory and promoted to the WK CDN.

<Update label="v0.13.0" description="20 August 2026">
  * Add support for nested external document `attachments` in `setDocumentSuggestion()`.
  * Improve SDK external document suggestions by checking availability in the background when the suggestion chip appears and attaching after the user clicks it.
  * Keep the SDK loader visible until the authenticated chat is ready, and show the SDK error page instead of a blank iframe when startup fails.
  * Fix downloading a generated Word document, which saved an HTML error page instead of the `.docx` file.
  * Hide the "Open in sidebar" button and the file chip preview for generated Word documents until the SDK has a document viewer.
  * Return users to the requested page in the main Libra app after an SDK link leads them through login or signup.
  * Preserve selected research sources when continuing from the SDK to Libra.
</Update>

<Update label="v0.12.1" description="4 August 2026">
  * Fix monKEY Belgium citation navigation to emit the canonical `monkey_be` research source id instead of the legacy `wolters_kluwer_monkey_be` slug.
  * Fix nested attachment/search submenus overflowing the SDK iframe viewport.
  * Use a chat-bubble icon for the New Chat button instead of a plain plus.
  * Add legal notice footer.
</Update>

<Update label="v0.12.0" description="14 July 2026">
  * Add `Libra.openChatById()` so product pages can reopen a cited Libra chat after extracting the `libraChatId` query parameter.
  * Add support for Kleos product.
  * Show an error message when the WK account is already linked/connected to another user.
  * Add `account_in_use` to the exported `LibraAuthErrorReason` union; the `libra:sdk:auth-error` event now emits this reason when the WK account is already linked/connected to another user.
  * Improve UI to match the Libra design system.
  * Show "monKEY (BE)", instead of "wolters\_kluwer\_monkey\_be", in insights.
</Update>

<Update label="v0.11.1" description="3 July 2026">
  * Fix inline event handler CSP violations in the SDK header's close button.
</Update>

<Update label="v0.11.0" description="29 June 2026" tags={["Breaking changes"]}>
  * BREAKING: Rename research source slugs to product-oriented names (e.g. `wolters_kluwer_nl` → `inview_legal_nl`, `wolters_kluwer_de` → `wko_de`). The old slugs are no longer accepted — integrators must migrate to the new names.
  * BREAKING: Remove the `ExternalDocumentSource` type. `ExternalDocument` now uses `ResearchSourceId` for its `source` field.
  * BREAKING: Drop research sources not exposed by the SDK (e.g. legal/web search, Swiss, EU, and US sources) from `ResearchSourceId`, which is now limited to the supported products' sources.
  * BREAKING: Replace `onExternalDocumentCitationClick` callback with `onCitationClick`. The event now carries `data` with `source`, `url`, and `content` (present for "To source", absent for "View source"). Hosts can call `event.preventDefault()` to prevent the SDK from opening the URL in a new tab.
  * Add a Libra-branded SDK headbar when `onClose` is provided; omitting `onClose` leaves the SDK header out. The close button calls `onClose`, and the host remains responsible for hiding the SDK wrapper and calling `Libra.detach()`.
  * Show a notice when a context-awareness document is unavailable in the FAB index.
  * Add support for signing out in proxy mode. It removes the user's identity link on the backend (the next CTE re-auth requires re-linking) and emits `unauthenticated / signout`.
</Update>

<Update label="v0.10.1" description="17 June 2026">
  * Re-add support for UMD and CJS.
</Update>

<Update label="v0.10.0" description="15 June 2026" tags={["Breaking changes"]}>
  * BREAKING: Drop support for UMD and CJS.
  * BREAKING: Add required `productId` param to `Libra.init()`. Identifies the legal-research product (e.g. `one_it`) and is sent on every backend request as the `X-Libra-SDK-Product-ID` header.
  * BREAKING: In proxy mode, the sign out button is hidden and `Libra.signOut()` throws.
  * BREAKING: Hide the close button when the host registers no `onClose` handler.
  * Add a splash screen during the initial load.
  * Redirect to Libra workspace when assistant's info icon is clicked from above the message input.
  * Show an error page if the BFF proxy returned a 5xx error during startup.
</Update>

<Update label="v0.9.0" description="4 June 2026" tags={["Breaking changes"]}>
  * BREAKING: Non-English locales are no longer bundled into `libra.js`. The main bundle now ships only `en-US`. The required locales must be either registered explicitly in `Libra.init({ locales: [...] })`, or added via a CDN locale script tag.
  * BREAKING: `Libra.init({ locale })` and `Libra.setLocale(locale)` now throw synchronously for unregistered locales, instead of silently falling back to `en-US`.
  * Add `proxy` option to `Libra.init()` for routing API requests through a BFF proxy server. When set, the SDK's localStorage token flow is disabled and auth is handled server-side. Static headers can be injected on every proxied request via `proxy.headers`.
  * Unify citations modal UI with other modals.
  * Fix translation keys containing an escaped quote (e.g. `I've verified my email`) being dropped from locale bundles.
  * Reduce main bundle size from 5.4mb to 3.2mb.
</Update>

<Update label="v0.8.2" description="29 May 2026">
  * Add CDN support via `https://cdn.wolterskluwer.io/wk/libra-sdk/<VERSION>/libra.js`
</Update>

<Update label="v0.8.1" description="27 May 2026">
  * Fix citations popovers not flipping above the message input.
</Update>

<Update label="v0.8.0" description="22 May 2026">
  * Add `onExternalDocumentCitationClick` callback to `Libra.init()`. Fires when the user navigates to a cited external document via "To source" in the citation tooltip (`type: 'chunk'`) or "View source" in the citation list (`type: 'document'`). The event carries `url`, `source`, and `type`, allowing the host app to handle navigation in-place instead of opening a new tab.
  * Add tooltip to the document suggestion chip.
  * Redesign the auth page.
  * Fix external attachment integrations (Kleos, SharePoint, RA-Micro) not working.
  * Keep research sources selected on "New Chat" button click.
  * Hide "To source" / "View source" buttons for uploaded-document citations, since the SDK has no PDF viewer.
  * Support the `disable_document_uploads` feature flag. When set, attachment options are hidden from the chat input.
  * Support the `sdk_only_access` feature flag. The "Continue in Libra" button is hidden, and other redirects (e.g. from assistants/workflows) are blocked by a toast. The toast behavior might get replaced in the future by a more fine-grained gating mechanism that either hides or disables the buttons.
</Update>

<Update label="v0.7.2" description="13 May 2026">
  * Add support for German Public Sector sources (`de_pubsec_jobcenter`, `de_pubsec_sozial`, `de_pubsec_auslr`, `de_pubsec_star`).
</Update>

<Update label="v0.7.1" description="13 May 2026">
  * Fix "Share via email" failing silently in Chromium browsers due to `mailto:` navigation being blocked from the SDK's iframe context.
  * Add `X-Libra-SDK-Version` request header so the backend can track SDK version usage/errors.
</Update>

<Update label="v0.7.0" description="12 May 2026">
  * Add Assistants and Workflows.
  * Redesign message input for SDK mode with compact controls, bottom-aligned dropdowns, and an inline prompt improve/undo button next to the textarea.
  * Fix onboarding view width not being full width on large screens.
  * Fix multiple issues with external document citations in SDK chats.
  * Fix export modal layout on narrow screens.
  * Improve performance of streamed messages by reducing re-renders and memory usage.
</Update>

<Update label="v0.6.2" description="6 May 2026">
  * Fix new chat after loading from history no longer reopens the previous chat.
</Update>

<Update label="v0.6.1" description="5 May 2026">
  * Fix Word export icon.
  * Improve citations icons.
</Update>

<Update label="v0.6.0" description="5 May 2026" tags={["Breaking changes"]}>
  * BREAKING: Remove `containerId` config field from `Libra.init()`. Call `Libra.attach(elementOrId)` directly after `init()` to mount the widget.
  * BREAKING: Rename `'interactive_login'` source to `'signin'` in `LibraAuthState` and `LibraAuthError`.
  * Add sign up and onboarding flows.
  * Add `'signup'` source to `LibraAuthState` and `LibraAuthError` so hosts can distinguish signup outcomes from signin outcomes.
  * Add `mountTarget` config field to `Libra.init()` so the host can choose the wrapper's parent element (defaults to `document.body`). Lets the host scope the SDK's `z-index: 999999` to a subtree they own instead of having it dominate the page's root stacking context.
  * Add `zIndex` config field to `Libra.init()` to override the wrapper's `z-index` (defaults to `999999`). Pairs with `mountTarget` so hosts can lower the SDK below their existing small `z-index` values (e.g. `5`) instead of bumping host overlays past `999999`.
  * Add `Libra.setLocale()` to change the widget's UI language at runtime.
  * Adhere to the configured locale when opening the login popup.
  * Preserve research sources selection when the chat is restored from history or after a host page reload.
  * Handle blocked states (e.g. unverified email, expired trial / canceled subscription, pending team membership, and inactive subscription) UI instead of showing a blank iframe.
  * Fix "Connect your account", "More about \{source}", and Otto Schmidt license-management actions silently doing nothing inside the SDK. They now open the relevant page or settings modal on the main app in a new browser tab.
  * Fix newly created chats not being restored after a host page reload. Previously, only chats reopened from history would resume.
</Update>

<Update label="v0.5.0" description="24 April 2026">
  * Add `onAuthStateChange` and `onAuthError` callbacks to `Libra.init()` so host can listen to auth changes/errors.
  * Add support for the following locales: `de-CH`, `fr-CH`, `it-CH`.
  * Restore last active chat session after page reloads and page navigation in MPAs *(multi-page applications)*.
  * Reduce bundle size from 5.1 to 3.9mb.
  * Reduce startup latency by 10-15%.
  * Use icon instead of text ("Add \{title} to chat" -> "+ \{title}") for document suggestion chips.
  * Hide "New Chat" button's label on small screens.
  * Fix citations list not showing when clicking on "Cited Sources" pill at the bottom of a message.
  * Fix "scroll to bottom" overlap with the research sources dropdown.
  * Fix "scroll to bottom" overlap with the document suggestion chip.
</Update>

<Update label="v0.4.0" description="21 April 2026" tags={["Breaking changes"]}>
  * BREAKING: Remove `documentSource` config field from `Libra.init()`.
  * BREAKING: Update `setDocumentSuggestion()` to accept `source` as a parameter.
  * Introduce new UI for the chat interface.
  * Reduce bundle size from 11.8mb to 5.1mb.
  * Fix multiple icons issues that were not loading properly in insights, citations, etc.
  * Fix the welcome message truncated text.
</Update>

<Update label="v0.3.0" description="16 April 2026">
  * Add `documentSource` config field on `Libra.init()` to identify the research source that owns documents suggested via `setDocumentSuggestion()`.
  * Add `Libra.setDocumentSuggestion()` to set a document suggestion from the host page. The document is shown as an "Add to chat" chip in the chat UI, and when the user clicks it, the document is attached to the message so Libra can retrieve its content.
  * Add `Libra.clearDocumentSuggestion()` to clear the current document suggestion.
  * Add `attach(elementOrId)` / `detach()` API to separate session lifecycle from DOM mounting. The iframe now lives on `document.body` and is positioned over the target element via `position: fixed` + rAF sync, so the full chat session (conversation, scroll position, streaming responses) survives across different containers and SPA route changes. `containerId` is now optional — if omitted, call `attach()` manually.
</Update>

<Update label="v0.2.0" description="13 April 2026">
  * Remove third-party type dependencies (`svelte`, `i18next`) from the built `.d.ts` files. Consumers no longer need `skipLibCheck` or Svelte/i18next in their dependencies.
  * Deliver config to the iframe via `postMessage` instead of an inline `<script>` tag. The iframe HTML is now fully static, so CSP hashes remain stable across config changes.
  * Move the input textarea to the bottom of the chat container.
</Update>

<Update label="v0.1.2" description="1 April 2026">
  * Namespace `localStorage` keys under `libra:` to avoid key collisions with the host page.
</Update>

<Update label="v0.1.1" description="1 April 2026">
  * Prevent session cookies from being sent with API requests.
  * Remove trailing slash from `baseUrl` to avoid double slashes in the URL.
</Update>

<Update label="v0.1.0" description="30 March 2026">
  * Initial release.
</Update>
