# messy-integration

> Provides connectivity between Messy and the UIs of integrating services

Latest version **1.5.0** (published 2022-07-03) · 0 weekly downloads

## Install

```sh
npm install messy-integration
pnpm add messy-integration
yarn add messy-integration
bun add messy-integration
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2022-07-03 |
| First published | 2022-05-09 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | The Messy Team |
| Maintainers | jonasdoubleyou |

## Links

- npm: https://www.npmjs.com/package/messy-integration
- npm.io page: https://npm.io/package/messy-integration

## Recent versions

- 1.5.0 (latest) — 2022-07-03
- 1.4.5 — 2022-06-26
- 1.4.4 — 2022-06-20
- 1.4.3 — 2022-06-20
- 1.4.2 — 2022-06-20
- 1.4.1 — 2022-06-20
- 1.4.0 — 2022-06-20
- 1.3.0 — 2022-06-20
- 1.2.0 — 2022-06-13
- 1.1.0 — 2022-06-13
- 1.0.0 — 2022-05-09

## README

# Messy Integration

This provides connectivity between the Messy User Area and the UIs of integrating services
 via browser cross-origin communication utilizing [`window.postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) and `<iframe>`s.

 ## Integrate your own Service with Messy

1. Install this package with `npm install messy-integration`
2. Load the Messy Integration:

```ts
import { startMessy } from "messy-integration";
const session = startMessy();

// Use session.onReady to show some loading animation, i.e.
(async function () {
    showSpinner();
    await session.onReady;
    hideSpinner();
})();
```

3. Whenever there's a Recipe in your application that the user wants to mix, start the integration:

```ts
const result = await session.run({
  recipe: {
    name: { en: "The best cake ever" },
    tasks: [
        {
            name: "misc",
            description: { en: "Switch on the oven" }
        },
        {
            name: "add",
            description: { en: "Two eggs" }
        },
        {
            name: "fill",
            amount: 1000,
            amountInUnit: 1,
            unit: "l",
            ingredient: { en: "water" }
        },
        {
            name: "fill",
            amount: 1000,
            amountInUnit: 900,
            unit: "g",
            ingredient: { en: "flour" }
        },
    ]
  }
});
```

For further details on the recipe see `./types.ts`.

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