Skip to content

Comments

Debug node response from browser#1063

Open
Ansonhkg wants to merge 4 commits intonagafrom
debug-node-response-from-browser
Open

Debug node response from browser#1063
Ansonhkg wants to merge 4 commits intonagafrom
debug-node-response-from-browser

Conversation

@Ansonhkg
Copy link
Contributor

WHAT

Enabled browser-side HTTP response logging via global DEBUG_HTTP and documented SDK debug logging in a new resources page.

…nse logging by setting window.DEBUG_HTTP='true' before loading the SDK
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables browser-side HTTP response logging by checking for a global DEBUG_HTTP flag and adds comprehensive documentation for SDK debug logging capabilities.

Changes:

  • Refactored DEBUG_HTTP detection into a reusable isDebugHttpEnabled() function that checks both Node.js environment variables and browser global variables
  • Added new documentation page explaining how to enable debug logging in both browser and Node.js environments
  • Updated documentation navigation to include the new debug logging resource

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/lit-client/src/lib/LitNodeClient/LitNodeApi/src/helper/sendNodeRequest.ts Extracted debug mode detection into isDebugHttpEnabled() function that supports both Node.js process.env and browser globalThis.DEBUG_HTTP
docs/sdk/resources/debug-logging.mdx Added comprehensive documentation for enabling debug logging in browsers and Node.js, including HTTP response logging
docs/docs.json Added new debug logging page to SDK resources section
.changeset/perky-hands-sleep.md Documented the browser DEBUG_HTTP feature as a patch change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Overview

Use SDK logs to inspect Lit Action requests and responses. Logging is disabled by default.
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation inconsistently refers to inspecting "Lit Action requests and responses" in the Overview section (line 8), but the DEBUG_HTTP flag is actually for logging HTTP responses from Lit node requests in general, not specifically Lit Actions. Consider revising this to be more accurate, such as "Use SDK logs to inspect Lit node requests and responses" or "Use SDK logs to inspect network communication with Lit nodes."

Suggested change
Use SDK logs to inspect Lit Action requests and responses. Logging is disabled by default.
Use SDK logs to inspect Lit node requests and responses. Logging is disabled by default.

Copilot uses AI. Check for mistakes.
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