open-index/open-npm huggingface dataset:
npm package: @nautical-commerce/app-bridge
Description: App bridge for Nautical Commerce dashboard embeds
Author: Nautical Commerce
Latest version: 0.0.6

# Nautical App Bridge

This repository builds the `@nautical-commerce/app-bridge` npm package. This package is used to provide a shared context between the Nautical Admin Dashboard and a dashboard app integration hosted in an iframe.

## Events

Events are messages that are sent downwards into the app iframe from the dashboard. The possible events that can be sent are:

| Event                       | Use                                                               |
| --------------------------- | ----------------------------------------------------------------- |
| `EventType.CommandResponse` | Sent in response to a `Command` being received by the dashboard.  |
| `EventType.Init`            | Provides initialization data to the app bridge from the dashboard |

## Commands

Commands are messages that are sent upwards from the app iframe to the dashboard. The possible commands that can be sent:

| Command                    | Use                                                                                             |
| -------------------------- | ----------------------------------------------------------------------------------------------- |
| `CommandType.Ready`        | Notify the dashboard that the app is ready. Will result in an `EventType.Init` event being sent |
| `CommandType.Close`        | Ask the dashboard to close the modal hosting the iframe                                         |
| `CommandType.Notification` | Send a notification to the dashboard for display to the user                                    |