Marketplace Settings UI: Unable to POST to App Storage (Invalid URL and hubspot.context undefined

We have a HubSpot Marketplace project (CRM extension + serverless functions + a Settings UI), and we’re trying to save configuration values to App Storage from the Settings page. Every attempt to POST to /crm/v3/extensions/app-storage fails with errors such as Invalid URL “/crm/v3/extensions/app-storage” and hubspot.context is always undefined inside the Settings iframe. We’re unsure whether the issue is with our Settings extension setup, our manifests, or how Marketplace projects are supposed to post to App Storage. Can someone confirm the correct way to call App Storage from a Settings extension in a Marketplace project and what configuration or registration steps might be missing?

TSX file with fetch code:

import { hubspot, Flex, Text, Input, Button } from “@hubspot/ui-extensions”;

export default hubspot.extend(({ actions }) => {
let currentUrl = “”;

async function saveToAppStorage() {
console.log(“Attempting to save URL:”, currentUrl);
console.log(“hubspot.context:”, hubspot?.context);

// In our project this is always undefined, which is the core issue
if (!hubspot?.context) {
console.error(“HubSpot extension context missing.”);
actions.addAlert({
type: “danger”,
title: “Save Failed”,
message: “hubspot.context is undefined inside the Settings iframe.”
});
return;
}

try {
const res = await hubspot.fetch(“/crm/v3/extensions/app-storage”, {
method: “POST”,
body: {
key: “license_server_url”,
value: currentUrl,
},
});
console.log(“Response:”, res);
} catch (err) {
console.error(“hubspot.fetch error:”, err);
actions.addAlert({
type: “danger”,
title: “Save Failed”,
message: “hubspot.fetch threw an error. See console for details.”
});
}
}

return (
<Flex direction=“column” gap=“md”>
<Text format={{ fontWeight: “bold” }}>App Configuration</Text>

<Input
name=“license_server_url”
label=“License Server URL”
placeholder="https://licenses.example.com"
onChange={(data) => {
currentUrl = data?.value ?? “”;
}}
/>

<Button type=“primary” onClick={saveToAppStorage}>
Save
</Button>
</Flex>
);
});

I’ve also included the following images which show the structure of my project. I have a card project with a settings page.

In the root folder:

In src folder:

JohnMichel_2-1776197793179.png

In src/app folder:

In src/app/cards folder:

In src/app/dist folder:

In src/app/settings folder:

Hey @JohnMichel,

Thanks for bringing this to the Community!

Here are a few resources that might point you in the right direction:

Tagging in some of our top contributors who may have experience with configuring this!

Hey @SteveHTM, @Josh, @RubenBurdin -- do you have any suggestions for @JohnMichel on this?
Thanks in advance!

Sam, Community Manager

Hi @SamTassey ,

Thanks for the resources, we’ve reviewed both pages carefully, and we believe there’s still an unresolved issue for our specific use case.

The value we’re trying to persist from the Settings UI is the URL of our own backend (for example, a license server endpoint). Because of this, we’re unable to follow the suggested pattern of “store data via your backend.”

The problem is:

  • The Settings UI is where the backend URL is first provided.
  • That URL must be persisted somewhere before any backend communication is possible.
  • If the value is stored only on the backend, we won’t be able to retrieve it later — because the backend itself cannot be reached until the URL already exists.

This is why we initially looked at HubSpot App Storage. It appears to be the only portal‑scoped, app‑scoped storage that exists independently of external infrastructure.

However, based on platform behavior and documentation:

  • UI Extensions (including Settings pages) cannot write directly to App Storage.
  • hubspot.fetch() from a Settings extension cannot call /crm/v3/extensions/app-storage.
  • hubspot.context is unavailable in the Settings iframe, so there is no client‑side access path to App Storage.

From what we can tell, the intended pattern is:

Settings UI → HubSpot serverless function → App Storage

That approach makes sense architecturally, but it introduces another limitation in our case: serverless functions are currently only available for private apps. We’ve heard that serverless support for public / Marketplace apps is in beta, but we haven’t seen clear documentation on availability or how to participate.

Could someone confirm:

  1. Whether using HubSpot serverless functions is the only supported way for a Marketplace app’s Settings UI to persist configuration values into App Storage, and
  2. Whether public / Marketplace apps can currently access serverless functions, or join a beta if this capability is still rolling out.

Clarification here would be extremely helpful, especially for Marketplace apps that need to store required configuration values inside HubSpot before any external backend can be contacted.

Thanks in advance for any guidance.