Skip to content

Releases: optave/interface-client-sdk-lib-dist

v3.2.2

13 Oct 06:38

Choose a tag to compare

Overview

This release introduces a full build & validation tooling suite for the JavaScript SDK, expands developer documentation, and refreshes generated example code.


🚀 Added

  • New BUILDING.MD with build guidance.
  • Comprehensive scripts/toolchain:
    • Analysis: tree-shaking validation, export surface diffs, bundle minimization checks.
    • Bundle size & governance utilities.
    • Test harnesses (CSP runner, UMD failure harness, token detection tests).
    • Validation tasks (schema drift guard, security scanner, governance checks, bundle assertion tasks).
    • Generation scripts for constants, examples, governance manifest, types, validators, and version sync.
    • Production build helpers (source maps generation, Webpack aliases, strict mode plugin).
    • Shared utilities (report-utilities.js, script-utilities.js) and a central test-environment.js.
  • Dedicated docs for analyzer-related tasks and token detection enhancements.
  • Added tsconfig.json, enabling TypeScript project structure in the JavaScript SDK workspace.

✨ Updated

  • Regenerated / refreshed SDK distribution bundles:
    • dist/browser.mjs
    • dist/browser.umd.js
    • dist/server.mjs
    • dist/server.umd.js
    • sdk-governance.json
  • Updated runtime platform code (notably browser crypto polyfill and environment adapter).
  • Updated integration layer and its README (integration/*).
  • Refreshed generated artifacts:
    • generated/README.md
    • generated/examples/* (browser + server examples)
    • validators.js
  • Updated root package manifest (package.json) to align with new tooling & scripts.
  • Webpack configuration adjustments:
    • webpack.browser.config.js
    • webpack.server.config.js
    • webpack.shared.umd.base.js
      Supporting expanded build + validation pipeline.

📚 Documentation

  • New focused docs in scripts/dev/docs/ explaining analyzer usage, export surface checks, and token detection improvements.
  • Expanded build + integration READMEs for clarity around usage scenarios.

v3.2.1

25 Sep 08:31
334670c

Choose a tag to compare

Overview

This release introduces the next-generation Optave JavaScript SDK.
It moves from a single-package build (v3.1.1) to a multi-SDK monorepo with modern build targets, robust TypeScript support, and stronger validation/security.
While most existing code will continue to run, there are key changes and deprecations you should review to ensure a smooth upgrade.


✨ Highlights

Modern Build & Packaging

  • Multiple build outputs: Browser ESM/UMD, Server ESM/UMD, and CommonJS (dist/browser.mjs, dist/server.mjs, dist/index.cjs).

  • TypeScript declarations: First-class types (.d.ts) ship out of the box.

  • Improved configuration validation: AsyncAPI-driven code generation with CSP-safe builds.

  • Environment-aware runtime: Auto-detects browser vs. server and applies smart defaults.

Expanded API & Events

  • New structured events: connection:open, connection:close, message:received, superpower.response, and more.

  • Enhanced error model: OptaveError with category codes and structured validation feedback.

  • Smart defaults: Automatic authTransport: 'subprotocol' and environment-dependent strict validation.

Security & Authentication

  • Browser token management: Introduces tokenProvider for secure backend-issued tokens.

  • Client secret protection: Secrets are now explicitly blocked in browser builds.

  • CSP-safe mode: Enabled by default for stricter content security compliance.


🔧 Migration Notes

If you’re upgrading from v3.1.1, the following updates are recommended:

Configuration

  • Replace nested auth: { tokenUrl, clientId, clientSecret } with flat keys:

    new OptaveSDK({ websocketUrl: "...", authenticationUrl: "...", clientId: "...", clientSecret: "..." // server-only });
  • On the browser side, remove any clientSecret and implement a tokenProvider:

    tokenProvider: async () => { const { token } = await fetch('/api/optave/ws-ticket').then(r => r.json()); return token; }

Method & Event Renames

  • Replace customerInteraction() with interaction().

  • Update event listeners to the new naming:

    • openconnection:open

    • messagemessage:received (legacy still emitted for now)

Payload Schema

  • If you craft raw JSON payloads manually, rename keys from snake_case to camelCase (e.g., thread_idthreadId, request_idrequestId, etc.).


⚠️ Deprecations

Deprecated | Use Instead | Removal Target -- | -- | -- customerInteraction() | interaction() | v4.0.0 Nested auth object | Flat authenticationUrl, clientId, clientSecret | v4.0.0 authenticate() in browser | tokenProvider | v4.0.0 Passing clientSecret in browser | Backend-issued token | v4.0.0

To future-proof your code, complete these migrations now.


🧩 Optional Enhancements

  • For Node.js performance, optionally install:

Read more