feat!: rename trackDocView → trackVisit (0.3.0)#3
Merged
Conversation
The function name implied this library only makes sense for docs sites, but the loose-detection tier in v0.2.0 plus consumer interest in marketing pages made clear that the "doc view" framing is too narrow. Rename the function and its options type; the `doc_view` event name itself stays the default because it's configurable via `eventName` — backward-compat for any existing PostHog dashboards that filter on it. BREAKING: import `trackVisit` instead of `trackDocView`, and `TrackVisitOptions` instead of `TrackDocViewOptions`. Since no production deployment depends on v0.2.0 yet, landing this as 0.3.0 rather than deprecating-then-removing at 1.0. Migration is a global find-and-replace at consumer sites. - src/track.ts: function + options type renamed - src/index.ts, src/types.ts, src/bots.ts docstring: updated references - test/track.test.ts: describe block + all 8 invocations renamed - README.md: quick start + how-it-works + FAQ updated - package.json: 0.2.0 → 0.3.0 All 47 tests green, typecheck clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Why
The function name implied this library is only useful for docs sites, but v0.2.0's coding-agent classification tier plus consumer interest in marketing / blog / landing pages made clear that the doc view framing is too narrow. Marketing sites shouldn't have to wrap a function called `trackDocView` to call it a page visit.
The default event name stays `doc_view` — it's already configurable via `eventName`, and changing it would break anyone's existing PostHog dashboards that filter on the event. The function name is separate from the event name it emits.
Breaking change
Migration is a global find-and-replace on both identifiers.
Why 0.3.0 and not a deprecation cycle
No production deployment depends on v0.2.0 yet (developer-docs PR #782 is still open, the starter is a demo, vercel/examples submission is under review). Clean break now is cheaper than carrying an alias to v1.0.
What's in
Verification
Follow-ups (separate PRs, after merge + publish)
🤖 Generated with Claude Code