@hyperfrontend/window-messages

@hyperfrontend/window-messages

Window messaging utilities for cross-frame communication.

Overview

The @hyperfrontend/window-messages package provides:

  • Standardized communication protocol
  • Type-safe message contracts
  • Pub/sub event bus
  • Runtime isolation between features

Installation

1
npm install @hyperfrontend/window-messages

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
import { WindowMessageBroker } from '@hyperfrontend/window-messages';

const broker = new WindowMessageBroker();

// Subscribe to messages
broker.on('message-type', (data) => {
  console.log('Received:', data);
});

// Publish messages
broker.send('message-type', { payload: 'data' });

Learn More