@mxenabled/widget-post-message-definitions
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Widget Post Message Definitions for TypeScript

Overview

This project defines and implements all Post Message parsing and dispatching in TypeScript. This is for use in Widget SDKs. The majority of this package was auto generated by the Widget Post Message Definitions project, and any modifications to a Post Message definition or handling should be done there.

Getting started

You can install this package via npm:

npm install --save @mxenabled/widget-post-message-definitions
import { dispatchConnectLocationChangeEvent } from "@mxenabled/widget-post-message-definitions"

dispatchConnectLocationChangeEvent("mx://connect/memberDeleted?metadata=...", {
  onMemberDeleted: (payload) => {
    console.log(`${payload.member_guid} has been deleted`)
  }
})

Dependencies

This package does not have any dependencies with the exception of the url package, which you may need if you're parsing post message events from URL change events.

The React Native SDK needs this package and has it as a dependency, but the Web SDK won't and we shouldn't install or import it. This allows us to keep both SDKs happy.

To install url in your project so you can parse post messages in location change events:

npm install --save url

Readme

Keywords

none

Package Sidebar

Install

npm i @mxenabled/widget-post-message-definitions

Weekly Downloads

3,250

Version

1.4.0

License

MIT

Unpacked Size

69.2 kB

Total Files

11

Last publish

Collaborators

  • jamesonmx
  • mwclemy
  • mxdevexperience
  • emilysallstrom
  • jgerlach
  • william.bridegroom
  • jgarrow
  • shalyn.huetter
  • drewwarren
  • sskousen
  • blueeagle500
  • craigtingey
  • jsfowles
  • inphomercial
  • marabd
  • minond
  • wolzey
  • whiteinge
  • cerinman
  • sambev
  • jrexdavis
  • nathan.nash
  • thechirinos