Releases: optave/interface-client-sdk-lib-dist
v3.2.2
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 centraltest-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.mjsdist/browser.umd.jsdist/server.mjsdist/server.umd.jssdk-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.mdgenerated/examples/*(browser + server examples)validators.js
- Updated root package manifest (
package.json) to align with new tooling & scripts. - Webpack configuration adjustments:
webpack.browser.config.jswebpack.server.config.jswebpack.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
READMEsfor clarity around usage scenarios.
v3.2.1
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:
OptaveErrorwith category codes and structured validation feedback. -
Smart defaults: Automatic
authTransport: 'subprotocol'and environment-dependent strict validation.
Security & Authentication
-
Browser token management: Introduces
tokenProviderfor 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
clientSecretand implement atokenProvider:tokenProvider: async () => { const { token } = await fetch('/api/optave/ws-ticket').then(r => r.json()); return token; }
Method & Event Renames
-
Replace
customerInteraction()withinteraction(). -
Update event listeners to the new naming:
-
open→connection:open -
message→message: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_id→threadId,request_id→requestId, etc.).
⚠️ Deprecations
To future-proof your code, complete these migrations now.
🧩 Optional Enhancements
-
For Node.js performance, optionally install: