# How to add server side code to Hubspot?

**URL:** <https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [December 27, 2023, 11:01am UTC](https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763 "2023-12-27T11:01:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AzharBondi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/azharbondi/32/89457_2.png) [@AzharBondi](https://community.hubspot.com/u/AzharBondi)\
**Post date:** [December 27, 2023, 11:01am UTC](https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763/1 "2023-12-27T11:01:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 27, 2023, 9:16pm UTC](https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763/2 "2023-12-27T21:16:21Z")

</div>

Hi, @AzharBondi 👋 It sounds like you are asking about utilizing Serverless Functions in HubSpot. Here’s the documentation:

- [Serverless functions (CMS Hub Enterprise)](https://developers.hubspot.com/docs/cms/data/serverless-functions)
- [Serverless functions in a Developer Project (Sales or Service Hub Enterprise)](https://developers.hubspot.com/docs/platform/serverless-functions)
- [Create a project (BETA)](https://developers.hubspot.com/docs/platform/create-a-project)

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

---

<div class="post-metadata">

**Author:** ![AzharBondi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/azharbondi/32/89457_2.png) [@AzharBondi](https://community.hubspot.com/u/AzharBondi)\
**Post date:** [January 2, 2024, 11:01am UTC](https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763/3 "2024-01-02T11:01:46Z")

</div>

Thank you [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) ! I will check these out !

---

<div class="post-metadata">

**Author:** ![RubenBurdin](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rubenburdin/32/75212_2.png) [@RubenBurdin](https://community.hubspot.com/u/RubenBurdin)\
**Post date:** [September 17, 2025, 4:16am UTC](https://community.hubspot.com/t/how-to-add-server-side-code-to-hubspot/96763/4 "2025-09-17T04:16:25Z")

</div>

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 )](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 )](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.
