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:

In src/app folder:
In src/app/cards folder:
In src/app/dist folder:
In src/app/settings folder:




