Repository navigation
feat(web): first-party Logdash web analytics - #58
Merged
Merged
Conversation
Proxy the tracker and events through /_ld on our origin (fixed upstream URLs, JSON only, 32 KB / 20-event limits, site ID check, only Origin, User-Agent and the client IP forwarded). Project and invite IDs in paths become :id before leaving the server. Identify follows auth.userData; track a few key actions.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
src/routes/_ld/script.js/+server.ts: GET proxy forhttps://logdash.io/sdk/web.js. Sends no browser headers upstream. Servesapplication/javascriptwithpublic, max-age=3600, s-maxage=3600, stale-while-revalidate=86400.src/routes/_ld/events/+server.ts: POST proxy forhttps://api.logdash.io/web_events.siteId(403), and malformed or empty batches (400).Origin,User-Agentandx-logdash-client-ip(fromgetClientAddress(), which reads Vercel'sx-forwarded-for)./app/project/<id>and/invite/<id>with:idbefore anything leaves our server. Returns the upstream status withno-store.src/app.html: adds the tracker tag once. It's the server-rendered head for every route, including thessr = falseapp pages.$lib/analytics/logdash.ts:trackandidentify. Both wait for the deferred script'sloadevent whenwindow.logdashisn't ready yet.identify(auth.userData?.id ?? null)runs on page load, after sign-in, and withnullon sign-out.login_completed {method},signup_completed,project_created {github_repo},secrets_saved,secrets_pushed {integrations},invitation_created {kind, role},invitation_accepted {kind},cli_authorized. None carry personal data.e2e/logdash-proxy.spec.ts: covers the rejection paths. None of those requests reach Logdash.data-respect-dnt: the site has no privacy policy that promises it. No consent gate or opt-out toggle existed to wire.Verified
pnpm check,pnpm lint, Cloudflare and Vercel builds, and the proxy spec (6/6) all pass.https://cryptly.dev(mapped to 127.0.0.1), with a local backend andnavigator.webdriver=false. Steps: home, SPA nav to/blog, local sign-in, passphrase, create a project, save, reload, sign out.origin: https://cryptly.devandx-logdash-client-ip. No other headers were sent./app/project/:id.document.cookiewas empty. Local and session storage held only app and SvelteKit keys.logdash.io; all traffic went tocryptly.dev/_ld/*.