@@ -202,7 +202,7 @@ Add the Session Replay plugin **after** Observability when configuring the Launc
202202
203203``` kotlin
204204import com.launchdarkly.observability.plugin.Observability
205- import com.launchdarkly.observability.replay.SessionReplay
205+ import com.launchdarkly.observability.replay.plugin. SessionReplay
206206
207207val ldConfig = LDConfig .Builder (LDConfig .Builder .AutoEnvAttributes .Enabled )
208208 .mobileKey(" your-mobile-key" )
@@ -225,6 +225,39 @@ Notes:
225225
226226Use ` ldMask() ` to mark views that should be masked in session replay. There are helpers for both XML-based Views and Jetpack Compose.
227227
228+ ##### Configure masking via ` PrivacyProfile `
229+
230+ If you want to configure masking globally (instead of calling ` ldMask() ` on each element), pass a ` PrivacyProfile ` to ` ReplayOptions ` :
231+
232+ ``` kotlin
233+ import com.launchdarkly.observability.replay.PrivacyProfile
234+ import com.launchdarkly.observability.replay.ReplayOptions
235+ import com.launchdarkly.observability.replay.view
236+ import com.launchdarkly.observability.replay.plugin.SessionReplay
237+
238+ val sessionReplay = SessionReplay (
239+ ReplayOptions (
240+ privacyProfile = PrivacyProfile (
241+ // New settings:
242+ maskViews = listOf (
243+ // Masks targets by *exact* Android View class (does not match subclasses).
244+ view(android.widget.ImageView ::class ),
245+ ),
246+ maskXMLViewIds = listOf (
247+ // Masks by resource entry name (from resources.getResourceEntryName(view.id)).
248+ // Accepts either "@+id/foo" or "foo".
249+ " @+id/password" ,
250+ " credit_card_number" ,
251+ ),
252+ )
253+ )
254+ )
255+ ```
256+
257+ Notes:
258+ - ` maskViews ` matches on ` target.view.javaClass ` equality (exact class only).
259+ - ` maskXMLViewIds ` applies only to Views with a non-` View.NO_ID ` id that resolves to a resource entry name.
260+
228261##### XML Views
229262
230263Import the masking API and call ` ldMask() ` on any ` View ` (for example, after inflating the layout in an ` Activity ` or ` Fragment ` ).
0 commit comments