How pzehle/sheets-to-hubspot works
Main Components
• Google Sheets Environment: This is where the trigger lives. The script located in scripts/webhook-script.js is meant to be added as a function in the Google Sheets environment (likely via Apps Script) and is set up as a trigger that fires when a row changes.
• HubSpot API: The external service that receives the contact note created by the integration.
Relationships and Data Flow
• A change in the Google Sheet (new/updated row) triggers the script in the Google Sheets environment (scripts/webhook-script.js).
• The webhook-script function then calls the Node.js function (either index.js or index.axios.js) to process the data.
• The Node.js component sends the formatted data as a contact's note to HubSpot via the HubSpot API, using one of the two methods available in the project.
Architectural Patterns/Design Principles
• Integration / Triggered Workflow: The project is event-driven where the Google Sheets trigger drives the integration workflow.
• Alternative Implementation: By providing two versions of the Node.js integration (client-based vs. axios), the design supports flexibility and can be used to compare performance or ease of use.
• Separation of Concerns: Dividing the trigger logic (in the sheets script) and the processing/communication logic (in index.js/index.axios.js) helps in managing modularity.
Relevant Technologies
• Google Sheets (Apps Script) for the data trigger.
• Node.js for the server-side integration logic.
• HubSpot API for external communication.
• Axios (HTTP client library) and the HubSpot Node.js API client library as part of the integration logic.
• If necessary, add annotations to indicate that two alternative implementation paths (using HubSpot Node.js API client vs. using axios) exist within the Node.js component.
Happy diagramming!