docs: document the telemetry subsystem on the docs site#149
Draft
tembo[bot] wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
Requesting review from @leoisadev1 who has experience with the following files modified in this PR:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PostHog telemetry subsystem (
packages/email-sdk/src/telemetry.ts, shipped in #141) is covered in the repoREADME.mdand inAGENTS.md(via the just-merged #145), but the canonical docs site — the one the README points users to ("Full docs live at email-sdk.dev/docs") — had no telemetry page. For a privacy-sensitive, on-by-default feature, that is the exact gap a user would go looking for and not find. Thetelemetryclient option was also missing from thecreateEmailClientreference.This is a documentation-only change.
Docs added / updated
content/docs/telemetry.mdx— a top-level page (parallel toauthentication.mdx) covering:stderrnotice.client created,email sent,email batch sent,cli command run) plus the fixed environment facts.~/.config/email-sdk/telemetry.json(with the$XDG_CONFIG_HOMEand read-only-fallback behavior).EmailValidationError/EmailProviderNotFoundErrorare never reported).EMAIL_SDK_TELEMETRY(0/false/off),DO_NOT_TRACK(1/true), the automaticNODE_ENV=testdisable, and the per-clienttelemetry: falseoption.content/docs/meta.json— addedtelemetryto the nav, afterauthentication.content/docs/reference/client.mdx— added thetelemetry?: booleanoption to thecreateEmailClientTypeTable(defaulttrue) and a sentence cross-linking to the new page and the env-var opt-outs.Codepaths covered
Every claim was verified against source at
main:packages/email-sdk/src/telemetry.ts—TELEMETRY_NOTICE,isTelemetryDisabled(env opt-outs +NODE_ENV=test),normalizeAdapterName(custom →custom),createTelemetry(anonymous ID, config dir /XDG_CONFIG_HOME, read-only fallback,CAPTURE_TIMEOUT_MS, per-process dedupe/MAX_EXCEPTIONS_PER_PROCESS),isReportableSendError,detectCiVendor, and theredactErrorMessagescrubbing set.packages/email-sdk/src/core.ts— thetelemetry: options.telemetry === false ? undefined : getTelemetry()gate and the exactcapture(...)property sets for theclient created,email sent, andemail batch sentevents.packages/email-sdk/src/cli.ts—setTelemetrySource("cli")and thecli command runcapture.packages/email-sdk/src/types.ts—telemetry?: booleanon the client options.Key knowledge gaps addressed
telemetryclient option is now in the API reference, matching the env-var story.Validation
bun run types:checkinapps/fumadocs— passed (MDX compiles,tsc --noEmitclean).bun run docs:versions:check— passed.No source or behavior changes; existing telemetry behavior is unchanged.
Triggered by the merge of #145 (docs automation on
pull_request.merged).