@vercel/analytics
Advanced tools
Comparing version 1.1.0 to 1.1.1
// package.json | ||
var name = "@vercel/analytics"; | ||
var version = "1.1.0"; | ||
var version = "1.1.1"; | ||
@@ -5,0 +5,0 @@ // src/queue.ts |
@@ -8,3 +8,3 @@ "use client"; | ||
var name = "@vercel/analytics"; | ||
var version = "1.1.0"; | ||
var version = "1.1.1"; | ||
@@ -11,0 +11,0 @@ // src/queue.ts |
@@ -1,4 +0,1 @@ | ||
// src/server/index.ts | ||
import "server-only"; | ||
// src/utils.ts | ||
@@ -61,4 +58,13 @@ function isBrowser() { | ||
var symbol = Symbol.for("@vercel/request-context"); | ||
var logPrefix = "[Vercel Web Analytics]"; | ||
async function track(eventName, properties, context) { | ||
var _a; | ||
if (typeof window !== "undefined") { | ||
if (!isProduction()) { | ||
throw new Error( | ||
`${logPrefix} It seems like you imported the \`track\` function from \`@vercel/web-analytics/server\` in a browser environment. This function is only meant to be used in a server environment.` | ||
); | ||
} | ||
return; | ||
} | ||
const props = parseProperties(properties, { | ||
@@ -70,7 +76,7 @@ strip: isProduction() | ||
console.log( | ||
`[Vercel Web Analytics] Can't find VERCEL_URL in environment variables.` | ||
`${logPrefix} Can't find VERCEL_URL in environment variables.` | ||
); | ||
} else if (!DISABLE_LOGS) { | ||
console.log( | ||
`[Vercel Web Analytics] Track "${eventName}" ${props ? `with data ${JSON.stringify(props)}` : ""}` | ||
`${logPrefix} Track "${eventName}" ${props ? `with data ${JSON.stringify(props)}` : ""}` | ||
); | ||
@@ -77,0 +83,0 @@ } |
{ | ||
"name": "@vercel/analytics", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Gain real-time traffic insights with Vercel Web Analytics", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
124588
1132
2