sentry-miniapp 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -125,10 +125,15 @@ Sentry.addBreadcrumb({ message: 'Tapped [Confirm Payment]', category: 'action',
125
125
 
126
126
  // Custom span
127
127
  await Sentry.startSpan({ name: 'fetch-user', op: 'http.client' }, async () => { /* ... */ });
128
+
129
+ // Privacy consent: after init({ requireConsent: true }), flush buffered events once granted
130
+ Sentry.setConsent(true);
128
131
  ```
129
132
 
130
133
  For per-page / per-scenario sampling use the `tracesSampler` callback (it overrides `tracesSampleRate`); see the [docs site · Configuration](https://sentry-miniapp.pages.dev/guide/configuration).
131
134
 
135
+ For privacy-compliance flows, initialize with `requireConsent: true`: before consent the SDK keeps collecting but sends no network requests, storing events locally. Call `Sentry.setConsent(true)` after the user agrees, or `Sentry.setConsent(false)` if consent is revoked.
136
+
132
137
  ---
133
138
 
134
139
  ## 🗺️ Source Map
package/README.md CHANGED
@@ -123,10 +123,15 @@ Sentry.addBreadcrumb({ message: '点击了[确认支付]', category: 'action', l
123
123
 
124
124
  // 自定义测速
125
125
  await Sentry.startSpan({ name: 'fetch-user', op: 'http.client' }, async () => { /* ... */ });
126
+
127
+ // 隐私合规:init({ requireConsent: true }) 后,用户同意隐私协议再补发缓冲
128
+ Sentry.setConsent(true);
126
129
  ```
127
130
 
128
131
  需要按页面 / 场景精细采样时用 `tracesSampler` 回调(设置后 `tracesSampleRate` 被忽略),写法见[文档站 · 配置项参考](https://sentry-miniapp.pages.dev/guide/configuration)。
129
132
 
133
+ 国内小程序 / 小游戏合规场景可在初始化时设置 `requireConsent: true`:同意前 SDK 照常采集但不发网络,事件先入本地缓冲;用户同意后调用 `Sentry.setConsent(true)` 补发,撤回同意时调用 `Sentry.setConsent(false)` 重新闸断。
134
+
130
135
  ---
131
136
 
132
137
  ## 🗺️ Source Map