Skip to content

feat(evlog): allow to configure request credentials in client logs & browser drain#232

Merged
HugoRCD merged 4 commits intoHugoRCD:mainfrom
MrLightful:browser-credentials
Mar 24, 2026
Merged

feat(evlog): allow to configure request credentials in client logs & browser drain#232
HugoRCD merged 4 commits intoHugoRCD:mainfrom
MrLightful:browser-credentials

Conversation

@MrLightful
Copy link
Contributor

@MrLightful MrLightful commented Mar 23, 2026

📚 Description

Summary

  • Add credentials option to BrowserDrainConfig (typed as RequestCredentials, defaults to 'same-origin')
  • Allows 'include' for cross-origin ingest endpoints

Motivation

The browser drain & client log transport hardcode credentials: 'same-origin' in its fetch call. This works when the app and ingest endpoint share the same origin, but fails to send cookies/auth for cross-origin requests — a common scenario in local development (e.g., app on localhost:5173, API on localhost:3000) and production setups where the ingest endpoint lives on a separate domain or subdomain (e.g., app on app.company.com, API on api.company.com). Making this configurable unblocks these use cases without changing default behavior.

Usage

  createBrowserLogDrain({
    drain: { endpoint: 'http://localhost:3000/api/logs', credentials: 'include' },
  })

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.
  • I have manually tested the feature in a use-case

@vercel
Copy link

vercel bot commented Mar 23, 2026

@MrLightful is attempting to deploy a commit to the HRCD Projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Thank you for following the naming conventions! 🙏

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 23, 2026

npm i https://pkg.pr.new/evlog@232
npm i https://pkg.pr.new/@evlog/nuxthub@232

commit: 84926ce

@MrLightful MrLightful marked this pull request as draft March 23, 2026 20:42
@MrLightful MrLightful force-pushed the browser-credentials branch 2 times, most recently from 1ab8d1a to 72a6027 Compare March 23, 2026 20:49
@MrLightful MrLightful marked this pull request as ready for review March 23, 2026 20:50
@MrLightful MrLightful force-pushed the browser-credentials branch from 72a6027 to 84926ce Compare March 23, 2026 23:47
@HugoRCD HugoRCD merged commit 767ba27 into HugoRCD:main Mar 24, 2026
10 of 13 checks passed
@MrLightful MrLightful deleted the browser-credentials branch March 24, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants