0.0.6 • Published 10 months ago

@membergetmember/integration v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

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});
0.0.3

11 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.6

10 months ago

0.0.2

11 months ago

0.0.1

11 months ago