Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function renderScript() {
const { publicRuntimeConfig: { segmentAnalytics } } = getConfig();
const opts = {
apiKey: segmentAnalytics.writeKey,
page: true // Set this to `false` if you want to manually fire `analytics.page()` from within your pages.
};
if (segmentAnalytics.skipMinimize === true) {
return snippet.max(opts);
}
return snippet.min(opts);
}
renderSnippet() {
const opts = {
apiKey: ANALYTICS_WRITE_KEY,
// note: the page option only covers SSR tracking.
// Page.js is used to track other events using `window.analytics.page()`
page: true,
}
if (NODE_ENV === 'development') {
return snippet.max(opts)
}
return snippet.min(opts)
}