no-native-http rule prevents usage of browser HTTP APIs (Fetch and XMLHttpRequest) in UI extensions.
Rule details
UI extensions run in a sandboxed web worker environment where browser HTTP APIs (fetch() and XMLHttpRequest) are intentionally replaced with error-throwing functions for security reasons.
All HTTP requests must go through either:
hubspot.fetch()for runtime HTTP requests with URL allowlisting.- Serverless functions for backend API calls in privately distributed apps using platform version
2025.1.
hubspot.fetch() is not a one-to-one replacement for the browser fetch() method. For example, hubspot.fetch() can only call URLs that have been added to permittedUrls in your app’s configuration. Learn more about fetching data in UI extensions.Examples
Browser fetch()
Instead of usingfetch():
hubspot.fetch():
hubspot is also allowed:
XMLHttpRequest
Instead of usingXMLHttpRequest:
hubspot.fetch():