Skip to content

feat: Add better docs for setting the user #12224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 7, 2025
Merged

feat: Add better docs for setting the user #12224

merged 4 commits into from
Jan 7, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Dec 30, 2024

This PR improves the docs for setting the user in JS SDKs.

  1. Updates the text about the default value for ip_address. This was more generic than needed, we can just make this JS specific. I think this is correct, but TBH not quite sure what the behavior is there actually 😓
  2. Add docs for server-side JS about how to set the user, concretely, for a single request or for all requests, e.g. in a middleware. For now I made this generic, we may add more specific examples for sub-guides that show specifically how to do this with a next.js middleware, etc. But IMHO we can do that in a follow up.

@mydea mydea requested review from lforst, Lms24, AbhiPrasad, chargome and a team December 30, 2024 08:13
@mydea mydea self-assigned this Dec 30, 2024
Copy link

vercel bot commented Dec 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 0:36am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 0:36am
develop-docs ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 0:36am

Copy link

codecov bot commented Dec 30, 2024

Bundle Report

Changes will increase total bundle size by 1.24kB (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 10.37MB 1.25kB (0.01%) ⬆️
sentry-docs-client-array-push 9.28MB 6 bytes (-0.0%) ⬇️

Copy link
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the fixes! 🛠️

mydea added a commit to getsentry/sentry-javascript that referenced this pull request Jan 3, 2025
This was an express-specific, rather undocumented behavior, and also conflicted with our privacy-by-default stance.

Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in a middleware to set the user on Sentry events.

Docs for this are already pending: getsentry/sentry-docs#12224
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Jan 7, 2025
This was an express-specific, rather undocumented behavior, and also conflicted with our privacy-by-default stance.

Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in a middleware to set the user on Sentry events.

Docs for this are already pending: getsentry/sentry-docs#12224
mydea and others added 3 commits January 7, 2025 10:58
Co-authored-by: Charly Gomez <charly.gomez@sentry.io>
Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
@mydea mydea force-pushed the fn/set-user-docs branch from 94c4988 to f9d2bda Compare January 7, 2025 12:15
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Jan 7, 2025
This was an express-specific, rather undocumented behavior, and also conflicted with our privacy-by-default stance.

Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in a middleware to set the user on Sentry events.

Docs for this are already pending: getsentry/sentry-docs#12224
@mydea mydea force-pushed the fn/set-user-docs branch from f9d2bda to ec38112 Compare January 7, 2025 12:22
@mydea mydea merged commit 47a010b into master Jan 7, 2025
11 checks passed
@mydea mydea deleted the fn/set-user-docs branch January 7, 2025 12:38
mydea added a commit to getsentry/sentry-javascript that referenced this pull request Jan 7, 2025
This was an express-specific, rather undocumented behavior, and also
conflicted with our privacy-by-default stance.

Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in
a middleware to set the user on Sentry events.

Docs for this are already pending:
getsentry/sentry-docs#12224

Extracted this out of
#14806
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants