Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-statsy

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-statsy - npm Package Compare versions

Comparing version 0.1.0 to 0.1.3

3

dist/gatsby-node.js

@@ -9,2 +9,5 @@ "use strict";

).default("statsy.observer"),
autoTrackPageviews: Joi.boolean().description(
`Whether to automatically track page views. Defaults to true.`
).default(true),
exclude: Joi.array().items(Joi.string()).description(

@@ -11,0 +14,0 @@ `If you need to exclude any path from the tracking system, you can add it (one or more) to this optional array as glob expressions.`

29

dist/gatsby-ssr.js

@@ -27,2 +27,3 @@ "use strict";

var import_react = __toESM(require("react"));
var import_gatsby = require("gatsby");
var import_minimatch = require("minimatch");

@@ -78,11 +79,17 @@ var onRenderBody = async ({ setHeadComponents, setPostBodyComponents }, pluginOptions) => {

`;
const code = `
window.statsy=function(...t){(window.statsyq=window.statsyq||[]).push(t)},window.statsy.call(window,"eventMiddleware",(function(t){const n=new
URL(t.href),e=[${excludeStatsyPaths.join(
","
)}];if("pageview"===t.name)for(const t of e)if(t.test(n.pathname))return null;const o=["${removeQueryParams.join(
'","'
)}"];for(const t of o)n.searchParams.delete(t);return
t.href=n.toString(),console.log({event:t}),t}));
`;
if (typeof pluginOptions.autoTrackPageviews === `boolean`) {
setPostBodyComponents([
/* @__PURE__ */ import_react.default.createElement(
"script",
{
key: "statsy-config",
dangerouslySetInnerHTML: {
__html: `window.statsyConfig = {
autoTrackPageviews: ${pluginOptions.autoTrackPageviews},
}`
}
}
)
]);
}
setHeadComponents([

@@ -92,3 +99,3 @@ /* @__PURE__ */ import_react.default.createElement("link", { rel: "preconnect", key: "preconnect-statsy", href: origin }),

/* @__PURE__ */ import_react.default.createElement(
"script",
import_gatsby.Script,
{

@@ -104,3 +111,3 @@ key: "script-statsy",

/* @__PURE__ */ import_react.default.createElement(
"script",
import_gatsby.Script,
{

@@ -107,0 +114,0 @@ key: "gatsby-plugin-statsy-middleware",

{
"name": "gatsby-plugin-statsy",
"version": "0.1.0",
"version": "0.1.3",
"description": "",

@@ -25,3 +25,3 @@ "main": "./dist/index.js",

"typescript": "^5.0.4",
"@statsy/analytics": "0.1.0"
"@statsy/analytics": "0.1.3"
},

@@ -28,0 +28,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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