Skip to content

bug-report

Helpers for a plugin’s bug reports: the environment a report needs, and a link to a GitHub issue form prefilled with it.

Cross-platform-loadable: the desktop operating-system lookup reads node:os, so it is imported dynamically, on desktop only.

The desktop installer version is Platform.build, which no public typing declares: Obsidian’s desktop startup sets it from Electron’s app.getVersion() (read from Obsidian 1.15.0), so it is read structurally here, and reads as unknown if a later version drops it.

Interface Description
BugReportEnvironment The environment a bug report needs.
BugReportIssueFormLink A link to a bug-report issue form, as buildBugReportIssueFormLink builds it.
BugReportPluginInfo A plugin, as a bug report names it.
BuildBugReportIssueFormLinkParams Parameters for buildBugReportIssueFormLink.
GetBugReportEnvironmentParams Parameters for getBugReportEnvironment.
GetBugReportIssueFormUrlParams Parameters for getBugReportIssueFormUrl.
GetGitHubIssueFormUrlParams Parameters for getGitHubIssueFormUrl.
Function Description
buildBugReportIssueFormLink Builds a link to a plugin’s bug-report issue form, prefilled with the environment and the given diagnostics. When the encoded link would be longer than BuildBugReportIssueFormLinkParams.maxUrlLength, the environment field gets BUG_REPORT_PASTE_INSTRUCTIONS instead, and the full text is returned as BugReportIssueFormLink.clipboardText for the caller to copy. Nothing is cut.
formatBugReportEnvironment Renders a bug report’s environment as a Markdown list.
getBugReportEnvironment Gets the environment a bug report needs: the plugin’s version, the other enabled plugins, the Obsidian and installer versions, the platform and the operating system.
getBugReportIssueFormUrl Gets a link to a plugin’s bug-report issue form (BUG_REPORT_ISSUE_FORM_TEMPLATE), prefilled with the environment, in the fields BugReportIssueFormFieldId names.
getGitHubIssueFormUrl Gets a link that opens a GitHub issue form with fields prefilled.
Enum Description
BugReportIssueFormFieldId The ids of the bug-report issue form’s fields that getBugReportIssueFormUrl prefills. GitHub prefills a field from a query parameter named after the field’s id, so a form must give its fields these ids for them to be filled.
Variable Description
BUG_REPORT_ISSUE_FORM_TEMPLATE The file name of the bug-report issue form, under .github/ISSUE_TEMPLATE.
BUG_REPORT_PASTE_INSTRUCTIONS The text the environment field holds when the report moved to the clipboard.
DEFAULT_BUG_REPORT_MAX_URL_LENGTH The default budget, in characters of the encoded URL, of a prefilled bug-report link. Measured against github.com on 2026-11-07, signed out: an issue-form URL up to about 6,540 characters was answered with the usual redirect to the form, about 8,088 with a 502, and 8,288 and more with a 414. 6,000 leaves room for a longer repository name and for a signed-in session’s own limits.