In the provided code, the url is being hardcoded, but I want to retrieve the URL dynamically from the HubSpot UI Extensions Public App Setting component. How can I achieve this?
class HttpWrapper {
private headers: Record<string, string>;
private baseurl: string;
constructor() {
this.headers = {
Authorization: “ABC”,
};
this.baseurl = “https://{{domain}}/api”;
}
public async get(url: string) {
try {
const response = await hubspot.fetch(this.baseurl + url, {
method: Method.GET,
headers: this.headers,
});
return await response.json();
} catch (error: any) {
throw error;
}
}
}
Hi @KGopalakrishn, I hope that you are well!
Thanks for asking the Community!
I’d like to share this documentation “Fetching data for public apps (BETA)” that might help you!
I also wanted to invite a couple of subject matter experts to this conversation: Hi @deepikaverma, @HubSpot_Corey and @miljkovicmisa do you have suggestions to help @KGopalakrishn, please?
Thanks so much and have a great day!
Best,
Bérangère
Hey @BérangèreL @deepikaverma, @HubSpot_Corey , @miljkovicmisa ,@KGopalakrishn
Just following up on this thread — any updates on how to retrieve a dynamic URL from the HubSpot UI Extensions Public App Settings? I’ve recently encountered the same challenge in my implementation and would appreciate any guidance.
Thanks in advance!
Hey, @MKatewa
You might consider making a new post for this and including your details along with any code blocks or samples that are relevant. Thanks! — Jaycee