Skip to content

feat!: rename trackDocView → trackVisit (0.3.0)#3

Merged
Gdewilde merged 1 commit intomainfrom
feat/rename-to-track-visit
Apr 19, 2026
Merged

feat!: rename trackDocView → trackVisit (0.3.0)#3
Gdewilde merged 1 commit intomainfrom
feat/rename-to-track-visit

Conversation

@Gdewilde
Copy link
Copy Markdown
Contributor

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

  • `trackDocView` → `trackVisit`
  • `TrackDocViewOptions` → `TrackVisitOptions`

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

  • `src/track.ts`: function + options type renamed
  • `src/index.ts`, `src/types.ts`, `src/bots.ts` doc comment: 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

Verification

  • `npm run typecheck` ✓
  • `npm test` — 47/47 ✓
  • `npm run build` ✓

Follow-ups (separate PRs, after merge + publish)

🤖 Generated with Claude Code

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>
@Gdewilde Gdewilde merged commit 4ae9781 into main Apr 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant