Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postmessage-communicator

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postmessage-communicator

[![Release](https://img.shields.io/github/v/release/wayfair-incubator/oss-template?display_name=tag)](CHANGELOG.md) [![Lint](https://github.com/wayfair-incubator/oss-template/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/wayfair-in

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

postmessage-communicator

Release Lint Contributor Covenant Maintainer

About The Project

Use this tool to communicate across an iframe using postmessage subscription.

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

  • yarn

    npm install --global yarn
    

Installation

  1. Clone the repo

    git clone https://github.com/wayfair-incubator/postmessage-communicator.git
    
  2. Install yarn packages and compile typescript code

    yarn
    yarn tsc
    

Communicator API

subscribe

Parameter NameRequiredDescriptionTypeDefault
eventTypeyesevent type to listen forstring
cbyescallback fired on event(e: MessageEvent) => void

unsubscribe

Parameter NameRequiredDescriptionTypeDefault
cbyescallback returned as subscription(e: MessageEvent) => void

post

Parameter NameRequiredDescriptionTypeDefault
typeyesevent type to post eg: addToCartstring | VendorEvent | ClientEvent
payloadyespost dataanything but a function

Vendor Communicator API

addToCart

Parameter NameRequiredDescriptionTypeDefault
customerUidyescustomer identifierstring
projectIdyesproject identifierstring
projectVersionnoproject versionstring
brandyesbrand descriptionstring
styleyesstyle descriptionstring
coloryescolorstring
urlyesthumbnail image urlstring
bomyesbill of materialsstring

designerHandOff

Parameter NameRequiredDescriptionTypeDefault
customerUidyescustomer identifierstring
projectIdyesproject identifierstring
projectVersionnoproject versionstring
brandyesbrand descriptionstring
styleyesstyle descriptionstring
coloryescolorstring
urlyesthumbnail image urlstring
areayesarea of roomnumber

requestToken

no parameters

projectDirty

no parameters

projectSaved

no parameters

projectDeleted

no parameters

Client Communicator API

init

Parameter NameRequiredDescriptionTypeDefault
tokenyesJWT token with initialization payloadstring
landingExperienceyesrequested landing page for applicationstring

refreshToken

Parameter NameRequiredDescriptionTypeDefault
tokenyesJWT token with initialization payloadstring

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For detailed contributing guidelines, please see CONTRIBUTING.md

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Link: https://github.com/wayfair-incubator/postmessage-communicator

Acknowledgements

This template was adapted from https://github.com/othneildrew/Best-README-Template.

Keywords

FAQs

Package last updated on 15 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc