{"id":14962912,"url":"https://github.com/samcyn/gatsby-source-hubspot-node","last_synced_at":"2026-02-15T09:04:46.358Z","repository":{"id":230742055,"uuid":"780051592","full_name":"samcyn/gatsby-source-hubspot-node","owner":"samcyn","description":"Seamlessly integrates your Gatsby site with HubSpot using gatsby-source-hubspot-nodes plugin","archived":false,"fork":false,"pushed_at":"2024-04-19T23:13:20.000Z","size":3216,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-18T04:45:49.704Z","etag":null,"topics":["cms","gatsbyjs","hubspot","javascript","reactjs","typescript"],"latest_commit_sha":null,"homepage":"https://gatsby-source-hubspot-node-plugin.netlify.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samcyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-31T15:07:40.000Z","updated_at":"2024-04-19T23:13:25.000Z","dependencies_parsed_at":"2024-04-10T01:36:33.317Z","dependency_job_id":"d68deb26-3e90-4ba9-93fd-3cda8c21d91a","html_url":"https://github.com/samcyn/gatsby-source-hubspot-node","commit_stats":{"total_commits":95,"total_committers":1,"mean_commits":95.0,"dds":0.0,"last_synced_commit":"3b19ff2258b18e447b548f1bd26b5d5a20132966"},"previous_names":["samcyn/gatsby-source-hubspot-nodes"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/samcyn/gatsby-source-hubspot-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samcyn%2Fgatsby-source-hubspot-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samcyn%2Fgatsby-source-hubspot-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samcyn%2Fgatsby-source-hubspot-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samcyn%2Fgatsby-source-hubspot-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samcyn","download_url":"https://codeload.github.com/samcyn/gatsby-source-hubspot-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samcyn%2Fgatsby-source-hubspot-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29474426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T06:58:05.414Z","status":"ssl_error","status_checked_at":"2026-02-15T06:58:05.085Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","gatsbyjs","hubspot","javascript","reactjs","typescript"],"created_at":"2024-09-24T13:30:44.490Z","updated_at":"2026-02-15T09:04:46.338Z","avatar_url":"https://github.com/samcyn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gatsby-source-hubspot-node\n\nThis plugin supports sourcing various HubSpot resources, such as blog posts, contacts, and forms, into Gatsby's GraphQL data layer, allowing you to query your HubSpot data right alongside your other data sources. Whether you're building a blog, a landing page, or a full-fledged website, gatsby-source-hubspot-node makes it straightforward to incorporate your HubSpot data.\n\n\n\n## Prerequisites\n\nBefore you begin, make sure you have the following:\n\n- Gatsby CLI installed\n- Node.js installed\n- An active HubSpot account\n\n\n\n## Installation\n\n```shell\nnpm install gatsby-source-hubspot-node\n```\n\nor\n\n```shell\nyarn add gatsby-source-hubspot-node\n```\n\n\n## How to use\n\nYou can have multiple instances of this plugin in your `gatsby-config` to read data from different Hubspot CMS. Be sure to give each instance a unique `nodeType` in the nodeTypeOptions.\n\n```js:title=gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-hubspot-node`,\n      options: {\n        // hubspot end point for blogs\n        endpoint: `process.env.HUBSPOT_API_ENDPOINT_FOR_BLOGS`,\n      },\n    },\n    {\n      resolve: `gatsby-source-hubspot-node`,\n      options: {\n        // hubspot end point for contact\n        endpoint: `process.env.HUBSPOT_API_ENDPOINT_FOR_CONTACTS`,\n        nodeTypeOptions: {\n          // The unique nodeType for each instance\n          nodeType: 'Contact',\n          schemaCustomizationString: `\n            type Contact implements Node {\n              id: ID!\n              state: String\n              slug: String\n            }\n          `,\n          apiResponseFormatter: (response) =\u003e response.results,\n          nodeBuilderFormatter({ gatsbyApi, input, pluginOptions }) {\n            const id = gatsbyApi.createNodeId(`${pluginOptions.nodeType}-${input.data.id}`);\n            const node = {\n              ...input.data,\n              id,\n              parent: null,\n              children: [],\n              internal: {\n                type: input.type,\n                contentDigest: gatsbyApi.createContentDigest(input.data),\n              },\n            } as NodeInput;\n            gatsbyApi.actions.createNode(node);\n          },\n        },\n      },\n    },\n  ],\n}\n```\nIn the above example, `Post` and `Contact` nodes will be created inside GraphQL. \n\n\n\n## Options\n\n1. **endpoint** (**Required**)\n    Remote url to hubspot resource. Check [Hubspot API Overview](https://legacydocs.hubspot.com/docs/overview) for more details\n\n2. **requestOptions** (**Optional**)\n    This is adapted from `node-fetch` library, [Node Fetch](https://github.com/node-fetch/node-fetch). Use this property to set headers, and methods. For details check the docs above.\n\n3. **searchParams** (**Optional**)\n    This is use to set search params along with the endpoint supplied to `gatsby-source-hubspot-node` plugin\n\n4. **nodeTypeOptions** (**Optional**)\n    This is an advanced option and should only be use if you understand node customization from Gatsby point of view. For deeper information and understanding check the docs here [Customizing the GraphQL Schema](https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/).\n\n    This option has four required field `nodeType`, `schemaCustomizationString`, `apiResponseFormatter` and `nodeBuilderFormatter`\n\n    a). **nodeType** (**Optional**)\n      - A unique nodeType for the `gatsby-source-hubspot-node` instance. It's default value is `Post`. It's advisable to make sure this value is unique if you have multiple instances of `gatsby-source-hubspot-node` plugin.\n\n    b). **schemaCustomizationString** (**Optional**)\n\n      - This is use to explicitly define the data shape, or add custom functionality to the query layer - this is what Gatsby’s Schema Customization API provides. Check docs for more info [Customizing the GraphQL Schema](https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/):\n\n        ```js:title=gatsby-config.js\n          module.exports = {\n            plugins: [\n              {\n                resolve: `gatsby-source-hubspot-node`,\n                options: {\n                  // The unique nodeType for each instance\n                  nodeType: `Post`,\n                  // hubspot end point for blogs\n                  endpoint: `process.env.HUBSPOT_API_ENDPOINT_FOR_BLOGS`,\n                  // this is just an example you can check the default value use under packages/plugin/src/config/schema-customization-options.ts\n                  schemaCustomizationString: `\n                    type Post implements Node {\n                      id: ID!\n                      absolute_url: String\n                      author: String\n                      author_name: String\n                    }\n                  `\n                },\n              }\n            ],\n          }\n        ```\n\n    c). **apiResponseFormatter** (**Optional**)\n\n      - This is use to format response api depending on hubspot response api. Take note this formatter has to return an array of Items that match `schemaCustomizationString` option above;\n\n    d). **nodeBuilderFormatter** (**Optional**)\n\n      - This is a function use to build node as per [Gatsby sourceNode API](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#sourceNodes). Note that once you have provided `schemaCustomizationString` in plugin options, you must provide  `apiResponseFormatter`, `nodeBuilderFormatter`. Here's an advanced configuration example, demonstrating how to use all available options:\n\n        ```js:title=gatsby-config.ts\n        import type { NodeInput, SourceNodesArgs } from 'gatsby';\n        // gatsby-config.js\n        module.exports = {\n          plugins: [\n            {\n              resolve: `gatsby-source-hubspot-node`,\n              options: {\n                nodeType: `Post`,\n                endpoint: `process.env.HUBSPOT_BLOGS_ENDPOINT`,\n                schemaCustomizationString: `\n                  type Post implements Node {\n                    id: ID!\n                    title: String\n                    author: String\n                    publishDate: Date @dateformat\n                  }\n                `,\n                requestOptions: {\n                  headers: {\n                    Authorization: `Bearer ${process.env.HUBSPOT_API_KEY}`,\n                  },\n                },\n                searchParams: {\n                  state: 'published',\n                },\n                apiResponseFormatter: (response) =\u003e {\n                  // Example formatter, for some api, it's response.results or simple response.\n                  return response.data;\n                },\n                nodeBuilderFormatter: ({ gatsbyApi, input }: {\n                  gatsbyApi: SourceNodesArgs\n                  // type is the nodeType supplied\n                  input: { type: string; data: T | Record\u003cstring, unknown\u003e };\n                }) =\u003e {\n                  // Example node builder\n                  const { actions, createNodeId, createContentDigest } = gatsbyApi;\n                  const { createNode } = actions;\n\n                  const nodeContent = JSON.stringify(input.data);\n\n                  const nodeMeta = {\n                    id: createNodeId(`${input.type}-${input.data.id}`),\n                    parent: null,\n                    children: [],\n                    internal: {\n                      type: `YourNodeType`,\n                      mediaType: `text/html`,\n                      content: nodeContent,\n                      contentDigest: createContentDigest(input.data),\n                    },\n                  } satisfies NodeInput;\n\n                  const node = Object.assign({}, input.data, nodeMeta);\n                  createNode(node);\n                },\n              },\n            },\n          ],\n        };\n        ```\n\n## Troubleshooting\n\n- API Rate Limits: HubSpot API has rate limits. If you encounter errors related to exceeding these limits, try to reduce the number of requests or implement caching.\n- Data Structure Mismatches: Make sure the structure defined in schemaCustomizationString matches the actual data structure returned by the HubSpot API.\n\n## Contributing\nContributions are welcome! For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE.md](./LICENSE.md) file for details.\n\n## Support\nFor support and questions, please open an issue on the GitHub repository or contact the plugin maintainers `samsoniyanda@outlook.com`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamcyn%2Fgatsby-source-hubspot-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamcyn%2Fgatsby-source-hubspot-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamcyn%2Fgatsby-source-hubspot-node/lists"}