UNPKG

@incedoinc/connect-web-sdk

Version:

A modern TypeScript SDK for integrating Incedo Connect financial services with support for inline and modal dialog modes

136 lines (113 loc) 5.46 kB
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [2.0.1] - 2025-10-07 ### Changed - **Documentation**: Comprehensive README update with enhanced API documentation - **Examples**: Updated all code examples to reflect v2.0.0 API changes - **Migration Guide**: Added detailed migration guide from v1.x.x to v2.0.0 - **Type Documentation**: Enhanced TypeScript type definitions and explanations - **Installation Instructions**: Updated package name and installation commands ### Added - **Advanced Examples**: Added comprehensive React and Vanilla JavaScript examples - **Event Handling Guide**: Detailed documentation for the new event system - **API Reference**: Complete API reference with all event types and callbacks ### Technical Details - No functional changes - documentation-only release - Package README now accurately reflects v2.0.0 functionality - Improved developer experience with better documentation ## [2.0.0] - 2025-10-07 ### Added - **Event Manager Integration**: Complete integration with `@repo/events-manager` package for robust event handling - **Enhanced Event System**: New structured event types (`LoadEvent`, `ErrorEvent`, `ConnectEvent`, `DoneEvent`) - **Improved Callback System**: Enhanced callback functions with typed event parameters - **Modular Architecture**: Refactored codebase with better separation of concerns - **Local Package Linking**: Support for local development with `file:` protocol dependencies ### Changed - **BREAKING**: Complete overhaul of event handling system - **BREAKING**: Changed callback signatures to accept typed event objects instead of raw data - **BREAKING**: Removed `PostMessageHandler` class in favor of event manager - **BREAKING**: Updated callback names: - `onInstitutionSelection``onEvent` (handles INSTITUTION_SELECTED events) - `onCancel` → `onDone` (handles completion/cancellation events) - **File Structure**: Reorganized source files into logical directories: - `src/modes/` - Mode implementations (dialog, inline) - `src/utils/` - Utility functions - `src/connect-web-sdk.ts` - Main SDK class - **Event Forwarding**: Improved event forwarding mechanism using event manager registry - **TypeScript Types**: Enhanced type definitions with event manager integration ### Removed - **BREAKING**: Removed `PostMessageHandler` class - **BREAKING**: Removed legacy event handling approach - **BREAKING**: Removed deprecated `closeDialog()` method - Cleaned up internal README documentation ### Technical Details - Migrated from manual postMessage handling to centralized event manager - Improved memory management with proper event listener cleanup - Enhanced type safety with structured event definitions - Better error handling and debugging capabilities - Supports both staged and committed changes for changelog updates ### Migration Guide For applications upgrading from v1.x.x: ```typescript // OLD (v1.x.x) sdk.launch({ connectUrl: 'https://example.com', onInstitutionSelection: (institution) => { console.log('Selected:', institution); }, onCancel: () => { console.log('User cancelled'); } }); // NEW (v2.0.0) sdk.launch({ connectUrl: 'https://example.com', onEvent: (event) => { if (event.eventName === 'INSTITUTION_SELECTED') { console.log('Selected:', event.data); } }, onDone: (event) => { console.log('Flow completed:', event); } }); ``` ## [1.1.0] - 2025-09-15 ### Added - New event type: **ACCOUNTS_SELECTED** - The SDK now listens for the ACCOUNTS_SELECTED event from the iframe and forwards it to the parent window via postMessage. - Enables parent applications to receive selected account details directly from the Connect flow. ### Changed - Updated event handling logic in ConnectSDK to support ACCOUNTS_SELECTED. ### Technical Details - No breaking changes. Existing event types and callbacks remain unaffected. ## [1.0.0] - 2025-08-26 ### Added - Initial release of Incedo Connect SDK - Support for inline iframe mode - Support for dialog modal mode - TypeScript definitions and full type safety - Comprehensive event handling system - PostMessage communication between iframe and parent - Configurable dialog options (width, height, title, closable) - Institution selection callbacks - Error handling and user cancellation support - Modern ESM and CommonJS builds - Zero external dependencies ### Features - **ConnectSDK Class**: Main SDK class for managing iframe connections - **Multiple Display Modes**: - Inline mode for embedding within containers - Dialog mode for modal overlays - **Event System**: Callbacks for load, error, institution selection, and cancellation - **Type Safety**: Full TypeScript support with exported types - **Modular Architecture**: Separated concerns with dedicated files for each mode - **Cross-browser Support**: Works on modern browsers (Chrome 60+, Firefox 55+, Safari 12+, Edge 79+) ### Technical Details - Built with TypeScript 5.0+ - Uses tsup for modern bundling - Exports both ESM and CommonJS formats - Includes source maps and declaration files - Implements proper cleanup and memory management