Conversation
…nse logging by setting window.DEBUG_HTTP='true' before loading the SDK
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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."
| 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. |
WHAT
Enabled browser-side HTTP response logging via global
DEBUG_HTTPand documented SDK debug logging in a new resources page.