Socket
Socket
Sign inDemoInstall

@mparticle/gatsby-plugin-mparticle

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mparticle/gatsby-plugin-mparticle - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

0

gatsby-browser.js

@@ -0,0 +0,0 @@ "use strict";

9

gatsby-ssr.js

@@ -14,11 +14,14 @@ "use strict";

var setHeadComponents = _ref.setHeadComponents;
var key = pluginOptions.apiKey;
var apiKey = pluginOptions.apiKey,
config = pluginOptions.config;
console.log('api? ', apiKey);
console.log('config? ', config);
return setHeadComponents([_react.default.createElement("script", {
key: "gatsby-plugin-mparticle",
dangerouslySetInnerHTML: {
__html: "(function (apiKey) {\n window.mParticle = window.mParticle || {};\n window.mParticle.eCommerce = { Cart: {} };\n \n window.mParticle.Identity = {};\n window.mParticle.config = window.mParticle.config || {\n isDevelopmentMode: true,\n useCookieStorage: true,\n };\n window.mParticle.config.rq = [];\n window.mParticle.ready = function (f) {\n window.mParticle.config.rq.push(f);\n };\n function a(o,t){return function(){t&&(o=t+\".\"+o);var e=Array.prototype.slice.call(arguments);e.unshift(o),window.mParticle.config.rq.push(e)}}var x=[\"endSession\",\"logError\",\"logEvent\",\"logForm\",\"logLink\",\"logPageView\",\"setSessionAttribute\",\"setAppName\",\"setAppVersion\",\"setOptOut\",\"setPosition\",\"startNewSession\",\"startTrackingLocation\",\"stopTrackingLocation\"],y=[\"setCurrencyCode\",\"logCheckout\"],z=[\"login\",\"logout\",\"modify\"];x.forEach(function(o){window.mParticle[o]=a(o)}),y.forEach(function(o){window.mParticle.eCommerce[o]=a(o,\"eCommerce\")}),z.forEach(function(o){window.mParticle.Identity[o]=a(o,\"Identity\")});\n \n var mp = document.createElement('script');\n mp.type = 'text/javascript';\n mp.async = true;\n mp.src = ('https:' == document.location.protocol ? 'https://jssdkcdns' : 'http://jssdkcdn') + '.mparticle.com/js/v2/' + apiKey + '/mparticle.js';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(mp, s);\n })('" + key + "')"
__html: "(function (apiKey) {\n window.mParticle = window.mParticle || {};\n window.mParticle.eCommerce = { Cart: {} };\n \n window.mParticle.Identity = {};\n window.mParticle.config = window.mParticle.config || " + JSON.stringify(config) + ";\n window.mParticle.config.rq = [];\n window.mParticle.ready = function (f) {\n window.mParticle.config.rq.push(f);\n };\n function a(o,t){return function(){t&&(o=t+\".\"+o);var e=Array.prototype.slice.call(arguments);e.unshift(o),window.mParticle.config.rq.push(e)}}var x=[\"endSession\",\"logError\",\"logEvent\",\"logForm\",\"logLink\",\"logPageView\",\"setSessionAttribute\",\"setAppName\",\"setAppVersion\",\"setOptOut\",\"setPosition\",\"startNewSession\",\"startTrackingLocation\",\"stopTrackingLocation\"],y=[\"setCurrencyCode\",\"logCheckout\"],z=[\"login\",\"logout\",\"modify\"];x.forEach(function(o){window.mParticle[o]=a(o)}),y.forEach(function(o){window.mParticle.eCommerce[o]=a(o,\"eCommerce\")}),z.forEach(function(o){window.mParticle.Identity[o]=a(o,\"Identity\")});\n \n var mp = document.createElement('script');\n mp.type = 'text/javascript';\n mp.async = true;\n mp.src = ('https:' == document.location.protocol ? 'https://jssdkcdns' : 'http://jssdkcdn') + '.mparticle.com/js/v2/' + apiKey + '/mparticle.js';\n var s = document.getElementsByTagName('script')[0];\n s.parentNode.insertBefore(mp, s);\n })('" + apiKey + "')"
},
__source: {
fileName: _jsxFileName,
lineNumber: 8
lineNumber: 10
},

@@ -25,0 +28,0 @@ __self: this

// noop
"use strict";
{
"name": "@mparticle/gatsby-plugin-mparticle",
"description": "Gatsby plugin to add mParticle to a site",
"version": "1.0.1",
"version": "1.0.2",
"main": "gatsby-ssr.js",

@@ -6,0 +6,0 @@ "author": "Danny Hendrix <dhendrix@mparticle.com>",

@@ -18,2 +18,5 @@ # gatsby-plugin-mparticle

logPageViews: true or false,
config: {
'Your mParticle config object here, if needed e.g. isDevelopmentMode',
},
}

@@ -20,0 +23,0 @@ }

@@ -6,3 +6,5 @@ import React from "react"

) => {
const key = pluginOptions.apiKey;
const { apiKey, config } = pluginOptions;
console.log('api? ', apiKey)
console.log('config? ', config)
return setHeadComponents([

@@ -17,6 +19,3 @@ <script

window.mParticle.Identity = {};
window.mParticle.config = window.mParticle.config || {
isDevelopmentMode: true,
useCookieStorage: true,
};
window.mParticle.config = window.mParticle.config || ${JSON.stringify(config)};
window.mParticle.config.rq = [];

@@ -34,3 +33,3 @@ window.mParticle.ready = function (f) {

s.parentNode.insertBefore(mp, s);
})('${key}')`,
})('${apiKey}')`,
}}

@@ -37,0 +36,0 @@ />,

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