# @availity/message-core

> availity wrapper for postMessage logic

Latest version **9.3.0** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @availity/message-core
pnpm add @availity/message-core
yarn add @availity/message-core
bun add @availity/message-core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.3.0 |
| Published | 2026-09-15 |
| First published | 2018-01-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.0.0 \|\| ^24.0.0 |
| Dependencies | 0 |
| Unpacked size | 29.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Kasey Powers <kasey.powers@availity.com> |
| Maintainers | dnoler, jselden, cbaker1, twarner, gregmartdotin, hnicbaker, chrishavekost, jordan-a-young, availity-cicd-bot, lauroxx |
| Keywords | availity, message |

## Links

- npm: https://www.npmjs.com/package/@availity/message-core
- Repository: https://github.com/availity/sdk-js
- Homepage: https://availity.github.io/sdk-js/resources/messaging
- Issues: https://github.com/availity/sdk-js/issues
- npm.io page: https://npm.io/package/@availity/message-core

## Recent versions

- 9.3.0 (latest) — 2026-09-15
- 4.0.21-alpha.21 (canary) — 2021-05-13
- 9.2.0 — 2026-06-15
- 9.1.0 — 2026-06-12
- 9.0.2 — 2026-06-09
- 9.0.1 — 2026-06-09
- 9.0.0 — 2026-06-08
- 8.1.0 — 2026-05-27
- 8.0.2 — 2025-10-03
- 8.0.1 — 2025-08-13
- 8.0.0 — 2025-05-14
- 7.0.5 — 2025-03-14
- 7.0.4 — 2025-03-13
- 7.0.3 — 2025-03-10
- 7.0.2 — 2025-02-18
- … 49 more at https://npm.io/package/@availity/message-core/versions

## README

# @availity/message-core

> A package wrapping the postMessage function with helper functions and security checks.

[![Version](https://img.shields.io/npm/v/@availity/message-core.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/message-core)
[![NPM Downloads](https://img.shields.io/npm/dt/@availity/message-core.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/message-core)
[![Dependecy Status](https://img.shields.io/librariesio/release/npm/@availity/message-core?style=for-the-badge)](https://github.com/Availity/sdk-js/blob/master/packages/message-core/package.json)

## Install

### NPM

```bash
npm install @availity/message-core
```

### Yarn

```bash
yarn add @availity/message-core
```

## Usage

The default export is a pre-configured `AvMessage` instance for cross-frame communication within the Availity portal.

```js
import avMessage from '@availity/message-core';

// Send a message to the parent window
avMessage.send({ event: 'my-event', data: { key: 'value' } });

// Subscribe to messages
const unsubscribe = avMessage.subscribe('my-event', (data) => {
  console.log('Received:', data);
});

// Unsubscribe when done
unsubscribe();

// Or unsubscribe by event name
avMessage.unsubscribe('my-event');

// Remove all subscribers
avMessage.unsubscribeAll();

// Enable or disable message handling
avMessage.enabled(false);

// Clean up when your app/component unmounts
avMessage.destroy();
```

Messages are validated against trusted Availity domains for security.

## Documentation

Check out more documentation at [availity.github.io](https://availity.github.io/sdk-js/resources/messaging)

---
_Source: https://npm.io/package/@availity/message-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
