Skip to main content
The no-console rule prevents usage of native console methods (console.log(), console.error(), etc.) in UI extensions.

Rule details

UI extensions should use the SDK’s structured logger utility instead of native console.* methods. This helps streamline UI extension debugging, as you won’t need to sort through other framework logs and network activity to find extension-specific logs. The SDK logger integrates with HubSpot’s logging infrastructure, providing proper log levels, formatting, and the ability to filter and search across installs. Using console.* methods bypasses these benefits.

Console method alternatives

Use the following UI extension alternatives instead of browser console methods:
Console APISDK Logger AlternativePurpose
console.log()logger.debug()Debug-level logging
console.info()logger.info()Informational logging
console.warn()logger.warn()Warning-level logging
console.debug()logger.debug()Debug-level logging
console.error()logger.error()Error-level logging
For user-facing errors: use actions.addAlert() or the <Alert> component instead of console output. See the next section for an example of each alternative.

Examples

Basic logging

Instead of using console.* methods for logging:
Use the SDK’s logger:

Error handling

Instead of using console.error():
Use logger.error() for debugging and actions.addAlert() for user-facing errors:
Or use the <Alert> component for inline error messages:
Last modified on March 29, 2026