These integration guides are not official documentation and the Strapi Support Team will not provide assistance with them.
What Is HubSpot?
HubSpot is a leading customer relationship management (CRM) platform designed to help businesses grow by improving marketing, sales, and customer service operations. HubSpot offers a suite of tools for email marketing, social media management, content creation, lead generation, and analytics, all within a unified platform.
HubSpot organizes data into distinct categories: Contacts store customer information, Companies track business entities, Deals manage sales opportunities, and Products handle your catalog. With custom integration using APIs or third-party tools, these categories can be mapped to Strapi content types to create a unified data structure across both systems.
Beyond just storing data, HubSpot automates processes that respond to changes in your Strapi content. When you publish a new product in Strapi, automated workflows can instantly trigger email campaigns, update customer segments, or alert your sales team.
Why Integrate HubSpot with Strapi
Integrating Strapi’s headless CMS with HubSpot’s CRM provides technical advantages that traditional systems can’t match. It combines content flexibility with marketing automation, a practical solution that scales with your business.
Flexible Content Delivery Across Platforms
Strapi's API-first design delivers content directly into marketing campaigns, emails, and landing pages. Create something once, use it everywhere. When you integrate HubSpot with Strapi, your content becomes ready for marketing automation across mobile apps, web applications, or any customer touchpoint.
Enhanced Data Management
This integration connects Strapi’s content types to CRM records, creating a single source of truth. Product details, blog posts, and customer data remain consistent across all platforms. Content flows automatically into product catalogs, contact records, and marketing materials, eliminating manual work and reducing errors.
Powerful Automation Capabilities
Content changes in Strapi trigger smart workflows, creating responsive marketing automation. When you publish a new product in Strapi, it can automatically launch email campaigns, refresh customer segments, or notify your sales team. Tools like n8n enable Strapi workflow automation, allowing these connections without requiring extensive custom coding.
Developer Control and Customization
Unlike traditional systems, the benefits of a headless CMS vs traditional are evident when you integrate HubSpot with Strapi, offering comprehensive customization options. Strapi's plugin system works with its API capabilities to build precisely what you need.
This flexibility and API-first approach create an environment where API synergy enhances integration with HubSpot's API capabilities. Whether you're using Strapi Cloud or the latest Strapi v5 features, the architecture adapts to your specific business requirements.
Real-World Impact
E-commerce companies benefit from automated product catalog syncing. Product data moves from Strapi into marketing automation, ensuring customers see consistent information across web stores, emails, and sales interactions. This integration improves operational efficiency and boosts conversion rates by delivering personalized, timely marketing content. For example, Bash used Strapi to power its e-commerce platform in 7 months.
Keep in touch with the latest Strapi and Hubspot updates
How to Integrate HubSpot with Strapi
Connecting Strapi with HubSpot requires proper authentication, data mapping, and sync logic. Here's how to implement it from API setup to real-time webhooks.
Prerequisites
You willl need Strapi v4+ with admin access to set up webhooks and API settings. Older versions lack the necessary API features for reliable integration. Your HubSpot account needs API access permissions, though features and rate limits depend on your plan.
Check that you can access the objects you want to sync—Contacts, Companies, Deals, or Products. Map which Strapi content types correspond to specific HubSpot objects, and decide if you need one-way or two-way sync before you begin.
Setting Up Secure API Authorization
OAuth 2.0 offers better security than basic API keys through detailed access control and token refresh. Create an app in your developer portal under account settings > Integrations > Private Apps, then generate client credentials.
Store these credentials securely using environment variables:
1const hubspotAuth = {
2 client_id: process.env.HUBSPOT_CLIENT_ID,
3 client_secret: process.env.HUBSPOT_CLIENT_SECRET,
4 redirect_uri: process.env.HUBSPOT_REDIRECT_URI,
5 scope: 'contacts crm.objects.contacts.read crm.objects.contacts.write'
6};
Build automated token refresh and limit API scopes to only what you need. Consider IP whitelisting and rate limiting for additional security.
Data Mapping Between Systems
Create field mappings between Strapi content and HubSpot objects with appropriate transformations. Properties have specific format requirements that often require conversion:
1{
2 "mappings": {
3 "strapi_field": "hubspot_property",
4 "title": "name",
5 "description": "description",
6 "price": "price",
7 "category": "product_category",
8 "created_at": "createdate"
9 },
10 "transformations": {
11 "price": "parseFloat",
12 "created_at": "toUnixTimestamp",
13 "category": "toLowerCase"
14 }
15}
Add validation to handle data type compatibility. Convert dates to Unix timestamps, format monetary values correctly, and respect character limits for text fields.
Integration Methods
You can choose from three approaches based on your technical requirements:
Custom Code Implementation provides full control through direct API calls and middleware in Strapi. The Strapi hook repository offers a starting point:
1const createHubSpotContact = async (contactData) => {
2 const response = await fetch('https://api.hubapi.com/crm/v3/objects/contacts', {
3 method: 'POST',
4 headers: {
5 'Authorization': `Bearer ${accessToken}`,
6 'Content-Type': 'application/json'
7 },
8 body: JSON.stringify({
9 properties: contactData
10 })
11 });
12 return response.json();
13};
n8n Workflow Automation enables low-code solutions for complex scenarios. Ready-made nodes for both platforms support visual workflow creation, multi-step processes, and conditional logic without extensive coding.
ContentMesh Product Sync specializes in e-commerce cases requiring product catalog synchronization with automated inventory updates and category mapping.
Setting Up Webhooks for Real-time Updates
Configure webhooks in Strapi admin under Settings > Webhooks for content creation, updates, and deletion events. Create handlers that process events and trigger corresponding API calls:
1module.exports = {
2 async afterCreate(event) {
3 const { result } = event;
4
5 const transformedData = transformDataForHubSpot(result);
6 await createRecord(transformedData);
7 }
8};
Add error handling, retry logic, and logging for webhook processing. Use queue systems for high-volume scenarios to prevent timeouts and ensure reliable delivery. Your webhook URLs should use HTTPS with authentication tokens and include idempotency checks to handle duplicate calls properly.
Keep in touch with the latest Strapi and Hubspot updates
Project Example (+ GitHub Project Repo)
Here's a real-world e-commerce product catalog sync that demonstrates how to integrate HubSpot with Strapi in action.
Scenario: Automated Product Launch Workflow
An online retailer manages their product catalog in Strapi and uses HubSpot for marketing automation. When products are added or updated in Strapi, the system automatically syncs this data to HubSpot's product catalog and triggers targeted marketing campaigns.
Architecture Overview
The implementation follows a direct data flow: Product data gets pulled from Strapi using REST API calls, then automatically maps and transforms to match HubSpot's format. No manual intervention needed.
Implementation Highlights
The core connection uses Strapi's webhook system to detect product changes:
1// Strapi webhook handler for product updates
2module.exports = {
3 async afterCreate(event) {
4 const { result } = event;
5 await syncToHubSpot(result);
6 }
7};
Automated data transformation handles field mapping between Strapi's flexible content structure and HubSpot's standardized product properties, keeping data consistent across platforms.
GitHub Repository Reference
The strapi-hook repository provides a practical template with foundational hooks and connection patterns. You will find authentication handling, data mapping techniques, and webhook configuration best practices.
Expected Outcomes
This setup delivers automated product synchronization that eliminates manual data entry, ensures marketing campaigns always feature current product information, and enables real-time workflow automation that triggers email campaigns, updates contact lists, and notifies sales teams when products launch or change.
The result is a transformation from static product management into a dynamic, automated system that keeps your marketing and sales teams aligned with your latest content.
Strapi Open Office Hours
If you have any questions about Strapi 5 or just would like to stop by and say hi, you can join us at Strapi's Discord Open Office Hours, Monday through Friday, from 12:30 pm to 1:30 pm CST: Strapi Discord Open Office Hours.
For more details, visit the Strapi documentation and the HubSpot documentation.