Hi there,
I hope my msg finds you well!
I created a connection between two APIs (external website and Hubspot) using VS Code.
Now I am wondering how could I add the script to Hubspot along with two other files (package.json and package-lock.json)
Should I simply create these files within a folder in the design tools?
would the server side code run normally in Hubspot?
I appreciate any help provided.
Best regards,
Azhar
Hi, @AzharBondi
It sounds like you are asking about utilizing Serverless Functions in HubSpot. Here’s the documentation:
If not, you’ll need to look into using an external service like AWS Heroku, for example, to execute your server-side code. Or, depending on your use case, handle the server-side logic on your server and use API calls to send/receive data to/from HubSpot.
Have fun building! — Jaycee
Thank you @Jaycee_Lewis ! I will check these out !
Hi @AzharBondi nice progress connecting the two APIs. Quick reality check for 2025: dropping package.json into Design Tools won’t run server code.
That area is only for theme assets. If you’re on Content Hub Enterprise, the native path is Serverless Functions inside a Developer Project. You’ll deploy with the HubSpot CLI, keep secrets via hs secrets, and call HubSpot using a Private App token. Projects are now the default way to package functions, endpoints, and UI in one place (https://developers.hubspot.com/docs/cms/reference/serverless-functions/serverless-functions-in-projects )
For a fast start, use the “Getting started with serverless functions” guide. It scaffolds the project, shows the .functions directory, and explains how requests run on HubSpot’s Node runtime with your secrets kept server side (https://developers.hubspot.com/docs/cms/start-building/features/serverless-functions/getting-started-with-serverless-functions )
And if what you’re really building is a sync layer between HubSpot and another system, doing it manually with serverless or an external app will get messy over time think retries, field mapping, conflict resolution, and data monitoring. That’s where Stacksync is the better option: it gives you a resilient two-way sync engine that automatically keeps HubSpot aligned with your source system, handles errors gracefully, and saves you from writing one-off scripts for every edge case. Instead of maintaining custom code across Heroku or other hosts, you focus on your business logic while Stacksync guarantees your records stay consistent in real time.