UK HUBSPOT DIAMOND PARTNER

HubSpot serverless functions,
engineered properly

Serverless functions give your HubSpot CMS site real back-end logic, running server-side on HubSpot's infrastructure with no server of your own to manage. We are the software engineering firm for HubSpot customers, so we design, build and harden these functions to production standards rather than gluing together no-code workarounds.

Node.js on HubSpot
Secrets kept off the browser
Real software engineering
On time, or 20% back
From £2,000
integration.spotdev
1
Connect
API authentication active
2
Configure
Field mapping complete
3
Transform
Data normalization running
4
Validate
Schema validation passing
5
Sync
Bi-directional sync active
Use cases

When you need a serverless function

Serverless functions are the right tool whenever a CMS page needs to do something secure or dynamic that front-end code cannot do safely on its own. Here are the patterns we build most.

Secure form and submission handling

Receive a form post server-side, validate it, then forward it to an external CRM, ERP, booking or payment platform. Your API keys stay in encrypted secrets on HubSpot's infrastructure and never reach the browser, so credentials cannot be scraped from page source.

Live third-party data on the page

Pull live pricing, stock levels, availability or reviews from an external API at request time and render it on a HubSpot CMS page. The function makes the call server-side and returns clean JSON, so the integration stays fast and the source system stays private.

Calculators and quoting tools

Run pricing logic, eligibility checks or quote calculations where the rates and rules must stay server-side. The browser only ever sees the result, so commercially sensitive logic and rate cards are never exposed to anyone inspecting the page.

Writing into HubDB and the CRM

Capture a custom on-page interaction and write the data straight into HubDB or the HubSpot CRM through a private app with scoped access. This powers dynamic listings, self-service updates and structured data capture beyond what a standard form can do.

A secure proxy for sensitive APIs

Use a function as middleware so secrets and tokens never touch the client. The page calls your endpoint, the endpoint calls the protected service, and the response comes back sanitised. This is the safe way to connect a public site to a private system.

Custom endpoints for portal features

Build lightweight API endpoints that power interactive components, gated content, lead enrichment or self-service portal features. These endpoints become the back-end glue behind the bespoke experiences we engineer on top of HubSpot.

How we build it

We treat every function as a real engineering deliverable, from scoping the contract to deploying it against HubSpot's documented limits.

Scroll to explore how we build it
1

Confirm the tier and the constraints

Serverless functions require Content Hub Enterprise (formerly CMS Hub Enterprise); they are not available on Starter or Professional. We confirm your tier up front, then design within HubSpot's limits: a 10 second execution cap per function, 128MB of memory, a 6MB payload, application/json only, and an account ceiling of 100 endpoints and 600 execution seconds per minute before requests start returning 429.

2

Design the endpoint and the data contract

We define the endpoints map in serverless.json, the HTTP methods each path accepts, and a clear request and response contract for the front end. Functions are deliberately fast and narrowly focused, so we shape the work to fit the 10 second window rather than trying to force long-running jobs into the wrong tool.

3

Build on the modern runtime

We build on HubSpot's nodejs20.x runtime and use the preloaded packages that ship with serverless functions, such as @hubspot/api-client and axios, directly. Where a build genuinely needs third-party npm dependencies via package.json, we use HubSpot's project-based serverless functions instead, choosing the right approach for the requirement rather than forcing one path to fit.

4

Secure secrets and scopes

Third-party credentials are stored as encrypted secrets, kept off the client entirely, and never given the same name as an environment variable to avoid value conflicts. Where the function reads or writes CRM or HubDB data, we provision a private app with only the scopes it actually needs.

5

Test, deploy and monitor

We add validation, error handling and graceful failure for rate limits and upstream timeouts, then deploy and verify against real traffic. HubSpot retains execution logs for 90 days, so we use them to confirm behaviour in production and to support the function after launch.

Frequently asked questions

Everything you need to know about our services

Guides

Further reading on serverless functions

Decision-stage reading to help you scope the right approach.

Serverless vs custom code vs integration

A decision matrix for the three approaches, by use case, reliability and cost.

The hidden costs of DIY custom code

The limits, retries and maintenance debt teams underestimate when building it themselves.

Talk to an engineer, not a salesperson

Tell us what you are trying to build. We will tell you honestly whether and how we can help, and what it would cost.