Violates the following Content Security Policy on HubSpot Custom Card

I’m building a HubSpot Custom Card and I get the error because it violates the following Content Security Policy directive: ‘connect-src none’.
This happens when I try to fetch companies from HubSpot with hubspot API. How can I solve this?

Hey @deteka - thanks for posting in the Community!
I’d like to tag in some experts to see if they have any insight for us! @Mike_Eastwood, @coldrickjack, and @stefen - any thoughts here?
Shane, Community Manager

Hi @deteka

There are a few options depending on whether your Custom Card is a Public or Private App (Card).

Personally, I usually use OAuth (public) because I want my Apps to be available in the Marketplace.

It’s much easier to access the HubSpot CRM directly with a Private App - but the App cannot be distributed through the Marketplace.

While I haven’t experienced that exact error my assumption is you are trying to access the HubSpot CRM directly using HubSpot fetch. There is a documented way to get a Token, from your server, to access. the HubSpot CRM… but I haven’t tried it yet.

There have been a lot of changes over the last few weeks, so I recommend checking out the new docs.

And, if you are using the old Developer Framework I recommend you upgrade, it will hurt at first but it’s worth it!

Have fun

Mike

Here to learn more about HubSpot and share my HubSpot Knowledge. I’m the founder of Webalite a Gold HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world’s first automated HubSpot Portal Audit that helps you work smarter with HubSpot.

Thank you, Mike!
You’re right, I’m trying to access HubSpot CRM directly using HubSpot Fetch. I’m now trying to use a private app, which looks easier, indeed. Thank you!