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

emarsys-integration-client

Package Overview
Dependencies
Maintainers
8
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emarsys-integration-client

Client library for Emarsys services.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67
increased by31.37%
Maintainers
8
Weekly downloads
 
Created
Source

Build status

Codeship Status for emartech/emarsys-integration-client-js Dependency Status devDependency Status

emarsys-integration-client-js

Emarsys Integration Client JS is a library providing methods of communication between Emarsys and integrated services running in an iframe.

Install

npm install emarsys-integration-client --save

Usage

var ClientApi = require('emarsys-integration-client');
var clientApi = ClientApi.init({
  global: window,
  integrationId: 'my-integration',
  integrationInstanceId: 1234567
});

In the code above, integrationId and integrationInstanceId should have the values passed in the iframe URL.

Library methods

alert.error(text: String)

alert.info(text: String)

alert.log(text: String)

alert.success(text: String)

alert.warn(text: String)

Calling the methods above will render different types of Emarsys UI alerts with the text given.

alert.send(options: Object)

It's a lower level method for displaying custom alerts.

Options

FieldRoleMandatoryDefault
text: StringAlert message.YES
icon: StringIcon class of the icon to be rendered on the left side of the alert. Eg. 'check' for a check mark or 'exclamation-circle' for an exclamation mark in a circle.NO
className: StringAlert sub-class to use when rendering the alert. Eg. 'e-alert-success' for a green bar, 'e-alert-danger' for a red one.NO
timeout: IntAmount of time after the alert will fade out and get removed from the DOM, in milliseconds.NO1500

enableButton(selector: String)

This will enable a button selected.

dialog.close()

Closing the dialog and removing it from DOM.

dialog.confirm(options: Object)

Rendering a confirm dialog.

Options

FieldRoleMandatoryDefault
title: StringTitle of the confirm dialog.YES
body: StringBody text of the confirm dialog.NO
cancel: StringText of Cancel button.YES
ok: StringText of OK button.YES

dialog.modal(options: Object)

Rendering a modal dialog with it's content in an iframe.

Options

FieldRoleMandatoryDefault
src: StringURL for the iframe providing the modal content.YES
width: IntWidth of the modal.NO650
height: IntHeight of the modal.NO500

dialog.submit(success: Boolean, data: Object)

Submitting a dialog.

Options

FieldRoleMandatoryDefault
success: BooleanTrue if the result of the dialog is truthy.YES
data: ObjectArbitrary object to send to the originating service.NO{}

navigate(options: Object)

Navigating the browser to a preset page.

Options

FieldRoleMandatory
target: StringThe prespecified target you would like to head to.YES
params.foo: ObjectThe general param the actual target needs.MIXED

Targets available

TargetActionParams
email_campaigns/listWill head to the campaign list.
email_campaigns/editWill open the editor with the campaign set.campaign_id
email_analysis/listWill head to reporting.
email_analysis/detailsWill head to reporting details of a campaign.campaign_id, launch_id

refresh()

Reloading the whole page.

resize(height: Int)

Resizing the iframe.

track(options: Object)

Sending a track message.

unload:init(options: Object)

Setting up click handler for <a> elements, popping a navigation confirm dialog when clicked. It makes sense to call this method right after your content gets dirty.

Options

FieldRoleMandatoryDefault
selector: StringSelector for ancestor elements of <a> elements.YES
confirm: ObjectOptions for confirm dialog. See dialog.confirm().NOOptions for a general unload confirm dialog.

unload:reset(selector: String)

Stopping to watch click events of elements selected by selector. It makes sense to call this method right after your content gets clean (ie. saved).

FAQs

Package last updated on 12 Jun 2018

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