Skip to content

Support Next.js v15+#31

Merged
PetrHeinz merged 6 commits intomainfrom
ph/next-v15-v16
Jan 8, 2026
Merged

Support Next.js v15+#31
PetrHeinz merged 6 commits intomainfrom
ph/next-v15-v16

Conversation

@PetrHeinz
Copy link
Member

  • Updated to handle Next.js 15 API changes (removed NextRequest.ip/geo, async params). Version bumped to 0.3.0 with peer dependency >=15.0. Leaving 0.2.x for ongoing Next.js 14 support.
  • Added conditional exports for better tree-shaking and client/server separation.
  • Made middleware method more flexible to accept both NextRequest and Request objects.

User Perspective:

  • Import BetterStackWebVitals from @logtail/next/webVitals instead of @logtail/next
  • Import useLogger in client-side builds from '@logtail/next/hooks' instead of @logtail/next

All existing APIs work the same - just need to upgrade Next.js and update the one import path.

- Remove logger-v15/v16 examples, keep main logger + trpc examples
- Update library for Next.js 15+ support (drop Next.js 14)
- Fix BetterStackRequest type compatibility
- Restore client-side exports (useLogger, BetterStackWebVitals)
- Update examples to use Next.js 15 and proper logging
- Add params Promise handling for Next.js 15 route handlers
- Maintain backwards compatibility for core server functionality
Copy link
Contributor

@curusarn curusarn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@PetrHeinz PetrHeinz merged commit 154e1f8 into main Jan 8, 2026
11 checks passed
@PetrHeinz PetrHeinz deleted the ph/next-v15-v16 branch January 8, 2026 13:38
@PetrHeinz PetrHeinz changed the title Support Node.js v15+ Support Next.js v15+ Jan 8, 2026
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.

2 participants