-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/analytics and csp #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SunDevil311
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
SunDevil311
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
|
SunDevil311
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes look good. Merging pending successful completion of tests.
Types of changes
Description
Added
Introduced unified environment detection utility (
src/lib/utils/env.js) with full JSDoc typing.process.envandimport.meta.envusage across SSR (Node) and client contexts.processis undefined.isDev,isProd,isAudit,isCI, andisTestAdded hybrid environment + host-based analytics guard in
src/lib/stores/posthog.js.auditmode or when hostname matches*.audit.netwk.pro.detectEnvironment()utility for centralized logic.Changed
Updated
hooks.server.jsto include a dedicated audit environment block for Content Security Policy (CSP).posthog.com,posthog-assets.com)./api/mock-csp) in audit mode.test,audit, andprodsecurity policies.NODE_ENV,ENV_MODE).Refined environment resolution logic to ensure accurate mode detection in both local builds and Vercel deployments.
vite --mode auditandPUBLIC_ENV_MODE=auditbehave consistently.Refactored Branch Guard workflow (
.github/workflows/branch-guard.yml) for improved accuracy and reduced noise.master,main).contents: read) and executes entirely without repository writes.Fixed
process.envbeing undefined.env.jsforprocessavailability.Developer Notes
This enables analytics filtering and CSP hardening for the audit environment.
Checklist
Pull requests are part of a collaborative process — we welcome contributions and review each one carefully. For all but the smallest changes, you can expect maintainers to request improvements or clarifications.
Please check back after opening your PR and be responsive to feedback so we can get your contribution merged quickly.
Thanks for helping improve Network Pro Strategies!