Repository: getsentry/sentry
Pull request: fix(replays): default mask/block setting in project creation should be true
fixes https://github.com/getsentry/sentry/issues/68688

for project creation, pass in a default `replayOptions` param since one isn't set:

<img width="1266" alt="SCR-20240411-hwpk" src="https://github.com/getsentry/sentry/assets/56095982/e0272c8a-ad00-4a6c-84ad-c35baea3491a">


Problem statement:
default mask/block setting for replay in project creation should be true
Hey team, when we create a new JS project and are presented with the code to paste into our app, we have masking turned off for the replay integration. However, in the docs this option is set to true (and the default value for this option is true as well). We received feedback from a customer about this, and they want the option to be set to true upon project creation, so that their other org users will not create new projects that transfer PII. Can we change the code we show upon project creation so that it’s the same as the docs?
Here’s their feedback:

```We would like to enforce masking in replays for every app so that the app does not have to possibility to turn off masking. Is this possible? Also on a side-note, you are pretty clear about using masking in your documentation, but when I create an new app, the config comes with masking off. Shouldn't this be default true instead of default false?```

Hints from issue discussion:

Commit message: fix(replays): default mask/block setting in project creation should be true

Patch to review:
diff --git a/static/app/gettingStartedDocs/javascript/javascript.tsx b/static/app/gettingStartedDocs/javascript/javascript.tsx
index 129c2c5df41d8b..58a583b20d1902 100644
--- a/static/app/gettingStartedDocs/javascript/javascript.tsx
+++ b/static/app/gettingStartedDocs/javascript/javascript.tsx
@@ -46,7 +46,7 @@ ${getFeedbackConfigOptions(params.feedbackOptions)}}),`
   }${
     params.isReplaySelected
       ? `
-        Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions)}),`
+        Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions ?? {block: true, mask: true})}),`
       : ''
   }
 ],${
@@ -67,7 +67,6 @@ ${getFeedbackConfigOptions(params.feedbackOptions)}}),`
 }
 });
 `;
-
 const getVerifyJSSnippet = () => `
 myUndefinedFunction();`;
 


Code review comments:
diff_hunk: @@ -46,7 +46,7 @@ ${getFeedbackConfigOptions(params.feedbackOptions)}}),`
   }${
     params.isReplaySelected
       ? `
-        Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions)}),`
+        Sentry.replayIntegration(${getReplayConfigOptions(params.replayOptions ?? {block: true, mask: true})}),`
path: static/app/gettingStartedDocs/javascript/javascript.tsx
text: @user1:
I would rather pass it in https://github.com/getsentry/sentry/blob/master/static/app/components/onboarding/gettingStartedDoc/onboardingLayout.tsx, then it is done at a central point for all platforms during creation.

@author:
good catch @user1! fixed