@weldsuite/helpdesk-widget-sdk 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1289,6 +1289,15 @@ class MessageBroker {
1289
1289
  this.logger = logger.child('[MessageBroker]');
1290
1290
  this.iframeManager = iframeManager;
1291
1291
  this.security = new SecurityManager(config.security, this.logger);
1292
+ // Automatically trust messages from the widget's base URL
1293
+ // The iframes load from api.baseUrl, so we must accept their postMessages
1294
+ try {
1295
+ const widgetOrigin = new URL(config.api.baseUrl).origin;
1296
+ this.security.addAllowedOrigin(widgetOrigin);
1297
+ }
1298
+ catch {
1299
+ // Invalid URL, will rely on configured allowedOrigins
1300
+ }
1292
1301
  this.rateLimiter = new RateLimiter(100, 60000); // 100 messages per minute
1293
1302
  // Bind handlers once for proper cleanup
1294
1303
  this.boundHandleMessage = this.handleMessage.bind(this);
@@ -2394,7 +2403,7 @@ class StateCoordinator {
2394
2403
  }
2395
2404
  }
2396
2405
 
2397
- var version = "1.0.13";
2406
+ var version = "1.0.14";
2398
2407
  var packageJson = {
2399
2408
  version: version};
2400
2409