Skip to content

feat: add getProps callback and pathMatcher utility#32

Merged
vklimontovich merged 3 commits intomainfrom
worktree-staged-napping-pnueli
Feb 26, 2026
Merged

feat: add getProps callback and pathMatcher utility#32
vklimontovich merged 3 commits intomainfrom
worktree-staged-napping-pnueli

Conversation

@vklimontovich
Copy link
Collaborator

Summary

  • Add getProps callback to NextlyticsConfig.callbacks — derives extra event properties
    from request context on every request, merged into event.properties
  • Add pathMatcher() utility for Next.js-style [param] path matching with not
    exclusion and prefix mode
  • Add path: string to RequestContext so callbacks have access to the current URL path

Test plan

  • bun run typecheck — passes
  • bun run test — 23 new path-matcher tests pass (33 total)
  • bun run build — compiles cleanly

🤖 Generated with Claude Code

vklimontovich and others added 2 commits February 26, 2026 13:30
Add `getProps` to config callbacks for deriving event properties
from request context. Add `pathMatcher()` for Next.js-style
`[param]` path matching. Add `path` to `RequestContext`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Middleware always returned NextResponse.next(), breaking composable
middleware pattern where consumers check `if (response) return response`
@vklimontovich vklimontovich marked this pull request as ready for review February 26, 2026 19:12
@vklimontovich vklimontovich merged commit 4427598 into main Feb 26, 2026
3 checks passed
@vklimontovich vklimontovich deleted the worktree-staged-napping-pnueli branch February 26, 2026 19:23
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