sentry-miniapp 1.11.3 → 1.12.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.
Files changed (41) hide show
  1. package/README.en.md +2 -0
  2. package/README.md +2 -0
  3. package/dist/sentry-miniapp.cjs.js +13 -6
  4. package/dist/sentry-miniapp.cjs.js.map +1 -1
  5. package/dist/sentry-miniapp.esm.js +1680 -1507
  6. package/dist/sentry-miniapp.esm.js.map +1 -1
  7. package/dist/sentry-miniapp.umd.js +13 -6
  8. package/dist/sentry-miniapp.umd.js.map +1 -1
  9. package/dist/types/appLifecycle.d.ts +27 -0
  10. package/dist/types/appLifecycle.d.ts.map +1 -0
  11. package/dist/types/client.d.ts +5 -1
  12. package/dist/types/client.d.ts.map +1 -1
  13. package/dist/types/crossPlatform.d.ts +0 -4
  14. package/dist/types/crossPlatform.d.ts.map +1 -1
  15. package/dist/types/index.d.ts +1 -1
  16. package/dist/types/index.d.ts.map +1 -1
  17. package/dist/types/integrations/httpcontext.d.ts +0 -8
  18. package/dist/types/integrations/httpcontext.d.ts.map +1 -1
  19. package/dist/types/integrations/index.d.ts +2 -0
  20. package/dist/types/integrations/index.d.ts.map +1 -1
  21. package/dist/types/integrations/minigame-framerate.d.ts +9 -0
  22. package/dist/types/integrations/minigame-framerate.d.ts.map +1 -1
  23. package/dist/types/integrations/networkstatus.d.ts +1 -0
  24. package/dist/types/integrations/networkstatus.d.ts.map +1 -1
  25. package/dist/types/integrations/pagebreadcrumbs.d.ts +6 -4
  26. package/dist/types/integrations/pagebreadcrumbs.d.ts.map +1 -1
  27. package/dist/types/integrations/router.d.ts +6 -1
  28. package/dist/types/integrations/router.d.ts.map +1 -1
  29. package/dist/types/integrations/session.d.ts +9 -8
  30. package/dist/types/integrations/session.d.ts.map +1 -1
  31. package/dist/types/integrations/system.d.ts +6 -1
  32. package/dist/types/integrations/system.d.ts.map +1 -1
  33. package/dist/types/polyfills.d.ts.map +1 -1
  34. package/dist/types/sdk.d.ts +0 -12
  35. package/dist/types/sdk.d.ts.map +1 -1
  36. package/dist/types/transports/offlineStore.d.ts +1 -1
  37. package/dist/types/transports/offlineStore.d.ts.map +1 -1
  38. package/dist/types/types.d.ts +33 -2
  39. package/dist/types/types.d.ts.map +1 -1
  40. package/dist/types/version.d.ts +1 -1
  41. package/package.json +9 -6
package/README.en.md CHANGED
@@ -95,6 +95,8 @@ Sentry.init({
95
95
  App({ onLaunch() {} });
96
96
  ```
97
97
 
98
+ Do not put `Sentry.init` inside `App.onLaunch`: by then `App()` has already been registered, so the SDK cannot wrap that first `onLaunch` call. App lifecycle breadcrumbs, the first session start, and cold-start timing which depends on the `onLaunch` start point may be missing. If you only need later errors, network breadcrumbs, and manual capture, initializing in `onLaunch` still works, but startup instrumentation is degraded.
99
+
98
100
  Default integrations already include **exception capture, performance monitoring, Source Map path normalization, network breadcrumbs, session and network status monitoring** — you usually don't pass `integrations` (doing so replaces the defaults). Full options (offline cache, trace propagation, breadcrumb toggles) are on the [docs site · Configuration](https://sentry-miniapp.pages.dev/guide/configuration).
99
101
 
100
102
  **Verify it works** — capture an event and check the Sentry "Issues" list:
package/README.md CHANGED
@@ -93,6 +93,8 @@ Sentry.init({
93
93
  App({ onLaunch() {} });
94
94
  ```
95
95
 
96
+ 不要把 `Sentry.init` 放进 `App.onLaunch` 里:那时 `App()` 已经完成注册,SDK 无法再提前包装本次 `onLaunch`,因此 App 生命周期面包屑、Session 首次启动以及依赖 `onLaunch` 起点的冷启动耗时可能拿不到。若只关心后续异常、网络面包屑和手动上报,放在 `onLaunch` 内仍可工作,但启动阶段能力会降级。
97
+
96
98
  默认集成已含**异常捕获、性能监控、Source Map 路径归一化、网络面包屑、Session 与网络状态监控**,通常无需手动传 `integrations`(传入会覆盖默认)。完整配置项(离线缓存、追踪头注入、面包屑开关等)见[文档站 · 配置项参考](https://sentry-miniapp.pages.dev/guide/configuration)。
97
99
 
98
100
  **验证是否打通**——主动捕获一个事件,到 Sentry「Issues」列表查看: