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 - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

39

dist/index.js

@@ -13,19 +13,26 @@ 'use strict';

var createInstance = function createInstance(options) {
var transmitter = new Transmitter(options);
var receiver = new Receiver(options.global);
return Object.assign({
messageToEmarsys: transmitter.messageToEmarsys.bind(transmitter),
messageToService: transmitter.messageToService.bind(transmitter),
addMessageHandler: receiver.addMessageHandler.bind(receiver)
}, MiscApi.create(transmitter, receiver), {
alert: AlertApi.create(transmitter),
dialog: DialogApi.create(transmitter, receiver),
updateHash: UpdateHashApi.create(transmitter),
unload: UnloadApi.create(transmitter),
intercom: IntercomApi.create(transmitter)
});
};
module.exports = {
init: function init(options) {
var transmitter = new Transmitter(options);
var receiver = new Receiver(options.global);
return Object.assign({
messageToEmarsys: transmitter.messageToEmarsys.bind(transmitter),
messageToService: transmitter.messageToService.bind(transmitter),
addMessageHandler: receiver.addMessageHandler.bind(receiver)
}, MiscApi.create(transmitter, receiver), {
alert: AlertApi.create(transmitter),
dialog: DialogApi.create(transmitter, receiver),
updateHash: UpdateHashApi.create(transmitter),
unload: UnloadApi.create(transmitter),
intercom: IntercomApi.create(transmitter)
});
},
integrationClient: createInstance({
global: window,
integrationId: 'DEFAULT',
integrationInstanceId: 'DEFAULT'
}),
init: createInstance,
comm: {

@@ -32,0 +39,0 @@ Transmitter: Transmitter,

@@ -51,3 +51,3 @@ {

"homepage": "https://github.com/emartech/emarsys-integration-client-js#readme",
"version": "2.3.0"
"version": "2.4.0"
}

@@ -19,4 +19,18 @@ # Build status

```javascript
var ClientApi = require('emarsys-integration-client');
var clientApi = ClientApi.init({
const { integrationClient } = require('emarsys-integration-client');
const result = await itegrationClient.getUrl({ target: 'email_analysis/list' });
const href = result.data.url;
```
# Legacy usage
Earlier versions of this package required you to create an instance with custom config.
Most methods now work without this, but if you are using `messageToService` explicitly,
you might still need to instantiate like this:
```javascript
var IntegrationClient = require('emarsys-integration-client');
var integrationClient = IntegrationClient.init({
global: window,

@@ -23,0 +37,0 @@ integrationId: 'my-integration',

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