@membergetmember/integration
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Member get member advertiser integration

Installation

Using yarn

yarn add @membergetmember/integration

Using npm

npm install @membergetmember/integration

Recommended usage (es6)

Setup integration

To set up an integration first you need to start an IntegrationService

  • Replace the demo shop ID (XXX) with your actual shop ID provided to you by MemberGetMember
import {IntegrationConfigInterface, IntegrationService, LanguageEnum} from '@membergetmember/integration';

const shopId: string = '053227a2-1036-11ee-be56-0242ac120002';

const integrationService: IntegrationService = new IntegrationService(<IntegrationConfigInterface>{
	shopId,
	language: LanguageEnum.ENGLISH,
});

Inline integration

integrationService.showInContainer(
	document.querySelector('#myUniqueElementReference')
);

Popup on button

<button onclick="integrationService.showAsPopup()" type="button">Click me</button>

Popup on load

document.addEventListener('DOMContentLoaded', () => integrationService.showAsPopup());

Alternate usage (commonjs)

Setup integration

const memberGetMember = require('@membergetmember/integration');
const shopId: string = '053227a2-1036-11ee-be56-0242ac120002';

const integrationService: memberGetMember.IntegrationService = new memberGetMember.IntegrationService({shopId});

Alternate usage manual import

Storing incoming requests

Add the following piece of code to the root of your app so that it loads on every page and stores any received dci.

<script src="/path/to/build/mgm-integration-bundle.min.js"></script>

Registering sale/lead

async await method

const shopId = '053227a2-1036-11ee-be56-0242ac120002';

const integrationService = new memberGetMember({shopId: shopId});

Readme

Keywords

Package Sidebar

Install

npm i @membergetmember/integration

Weekly Downloads

48

Version

0.0.6

License

ISC

Unpacked Size

216 kB

Total Files

76

Last publish

Collaborators

  • sadrichem