Noob Starter question - How do I get started with custom JS add-ons?

Noob Alert : I’m brand new, so please be patient!

So I’ve recently joined a company who are using HubSpot CMS for their company website. The person who maintains the website has some rudimentary HTML / CSS experience, but isn’t a developer.

I’ve been asked about whether they can display automated rollups of content (e.g. “Related Blog posts” or “Latest news”).
I can tell that HubSpot has a REST based API so I’m presuming this should be perfectly possible in JavaScript, but honestly have NO idea where to start.

Is there some kind of walkthrough how-to primer on adding custom JavaScript based components?
Would I need to create a custom “module” of some kind?
Apologies for the whole “**bleep** am I doing?” nature of the post, but feeling a bit thrown in at the deep end here.

Hello @MartinHatch,

if i understand you right, you want to include custom JS to your HubSpot Pages.
For this you have different optionen.
1. Upload a JS file to your Files, get the File URL.
Now go to Setting → Websites → Pages
Here you can find an option to add head or footer JS which will be included to all your pages
Add the following: (replace ###YOURSCRIPTURL### with the URL of your script)

<script src="###YOURSCRIPTURL###"></script>

2. You also can include custom JavaScript to custom modules, there is a section for that.

3. If you are using Templates (Drag and Drop based), you have an option to include JavaScript on the right side, its called “Linked JavaScript files”. For this option you need to create a new JavaScript file on the Design Manager. Then you can press the Template option add linked JavaScript file, and choose your JS file

There is also a good resource page for more information: Create and add a JavaScript file to HubSpot

- Chris

Hi @MartinHatch ,
When you use local it will automate created json by module look like this https://prnt.sc/1v9uisp
and custome module you can copy
Screenshot by Lightshot

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.
Thanks and Regards.