@evolv-delivery/device-data-pdp

0.4.2 • Public • Published

Example Audience Integration

Created for experiment DP Nudge

Sets sessionStorage item on /example/page/1 of evolv:example-value containing exampleValue.

Reads evolv:example-value on /example/page/2, setting boolean remoteContext entries for vz.exampleValue.


Setup

To create new-integration from this template in your /evolv/env-integrations folder:

rsync -av templates/ new-integration

And then customize your package.json, src/index.js, and README.md to fit your project

NPM scripts

npm run build Builds dist/../index.js files
npm run watch Automatically builds on save of src/index.js
npm run serve Hosts dist folder on port 8080
npm run dev Watch and serve
npm start Same as npm run dev
npm run publish Build and publish to npm

Local Hosting

Run npm start to host locally. To run in your browser inject the following into your <head> tag using Resource Override

(() => {
  if (window.self !== window.top) return;

  console.log('[evolv-local] example-integration: inject');

  const script = document.createElement('script');
  script.type = 'module';
  script.text =
    'import integration from "http://localhost:8080/dist/es/index.js"; console.log("[evolv-local] example-integration: load"); integration()';
  document.head.appendChild(script);
})();

Readme

Keywords

none

Package Sidebar

Install

npm i @evolv-delivery/device-data-pdp

Weekly Downloads

5

Version

0.4.2

License

ISC

Unpacked Size

13.1 kB

Total Files

4

Last publish

Collaborators

  • charles-evolv
  • joshua-barnard-evolv
  • yvanfrey-evolv
  • robertsevern
  • rcowin
  • matt-strom