@emartech/me-sdk-bridge

Copyright EMARSYS 2017 All rights reserved.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@emartech/me-sdk-bridge
1.7.0a year ago5 years agoMinified + gzip package size for @emartech/me-sdk-bridge in KB

Readme

Me-Sdk-Bridge-Js npm version
This script provides a JS interface that can be injected into an In App Message's html to make communication with the Mobile Engage SDK easier. The following methods are available on the global MEIAM object.

How to integrate

Include the uglified version (index.min.js) in the html.

Methods provided by the bridge

MEIAM.buttonClicked(<buttonId>, <callback>)

MEIAM.close(<callback>)

MEIAM.makeNetworkRequest(<url>, <method>, <headers>, <payload>, <callback>)

MEIAM.openExternalLink(<url>, <callback>)

MEIAM.requestPushPermission(<callback>)

MEIAM.triggerAppEvent(<name>, <payload>, <callback>)

MEIAM.triggerMEEvent(<name>, <payload>, <callback>)

MEIAM.gotoStep(<name>, <callback>)

Custom Attributes provided by the bridge

me-button-clicked="<buttonId>"

me-close=""

me-make-network-request='{"url": "<url>", "method": "<method>", "headers": <headers>, "payload": <payload>}'

href="<url>"

me-request-push-permission=""

me-trigger-app-event='{"type": "<name>", "payload": <payload>}'

me-trigger-event='{"type": "<name>", "payload": <payload>}'

me-goto-step="<name>"

Setting Up the Service

npm install

Running the tests

npm t

Run the test page

Install http-server first
npm i http-server -g

Start http-server in the lib's directory, for options see the documentation
http-server [options]

You can access the test page on http://localhost:8080/test.html

Default Commit Message Format

This module ships with the AngularJS Commit Message Conventions and changelog generator, but you can define your own style.
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject and a JIRA ticket id:
<type>(<scope>): <subject>
<BLANK LINE>
<body> - <JIRA ticket id>
<BLANK LINE>
<footer>

Full explanation
Copyright EMARSYS 2017 All rights reserved.