Skip to content

docs: fix WeChat miniprogram SDK docs (package name, tracing sampleRate, domain allowlist, error sources)#140

Merged
Fiona2016 merged 1 commit into
mainfrom
docs/miniprogram-sdk-review-fixes
Jul 3, 2026
Merged

docs: fix WeChat miniprogram SDK docs (package name, tracing sampleRate, domain allowlist, error sources)#140
Fiona2016 merged 1 commit into
mainfrom
docs/miniprogram-sdk-review-fixes

Conversation

@Fiona2016

Copy link
Copy Markdown
Contributor

背景

客户接入小程序 SDK 前对文档做了一次与 SDK 代码(fc-sdk-wechat-miniprogram @ 0.1.5)的逐项核对,发现两处阻断性错误和两处完备性缺口。

修改内容

🔴 阻断性错误

  1. 包名:文档写的 @flashcatcloud/fc-sdk-miniprogram 在 npm 上不存在(404),实际发布的是 @flashcatcloud/miniprogram-rum。zh/en 共 8 个文件(sdk-integration / compatible / data-collection / quickstart/app-management)。控制台前端的同名问题已在 main 分支修复。
  2. tracing.sampleRate 语义:代码中是 0–100 的百分比、默认 100(requestObservable.ts: Math.random() * 100 < sampleRate);文档误写为默认 10.5=50%,示例 sampleRate: 1 实际只采样 1% 请求。

🟡 完备性补充

  1. 接入指南「前提条件」补充微信公众平台 request 合法域名 配置步骤(真机上报的必要条件),并提示开发者工具「不校验合法域名」调试选项。
  2. 错误采集来源补全 3 类自动采集(startRum.ts:97-114):page-not-found(wx.onPageNotFound)、lazy-load(wx.onLazyLoadError)、network(请求失败时额外生成 error 事件)。

🟢 小修

  1. startPage(name?)name 参数实际可选。

验证

  • mint broken-links 通过(no broken links found)
  • 包名经 npm view 核实:fc-sdk-miniprogram 404,miniprogram-rum@0.1.5 存在
  • 其余参数默认值、字段名、会话/批量/限流常量均与 SDK 代码逐项核对一致

🤖 Generated with Claude Code

…omain allowlist step

- Replace non-existent npm package @flashcatcloud/fc-sdk-miniprogram with
  the actually published @flashcatcloud/miniprogram-rum (zh/en, 8 files)
- Fix tracing.sampleRate semantics: it is a 0-100 percentage with default
  100, not a 0-1 fraction; update example from 1 to 100
- Add WeChat request legal-domain allowlist configuration to prerequisites
- Document the three additional auto-collected error sources:
  page-not-found, lazy-load, network
- Mark startPage name parameter as optional

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jul 3, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
flashduty 🟢 Ready View Preview Jul 3, 2026, 6:26 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@Fiona2016 Fiona2016 marked this pull request as ready for review July 3, 2026 06:25
@Fiona2016 Fiona2016 merged commit 91a0c73 into main Jul 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant