{"_id":"@cabbiepete/gatsby-source-hubspot","_rev":"1-65d107bade32e9b5bc0618951290da36","name":"@cabbiepete/gatsby-source-hubspot","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cabbiepete/gatsby-source-hubspot","description":"Gatsby source plugin","repository":{"type":"git","url":"git+https://github.com/cabbiepete/gatsby-source-hubspot.git"},"author":{"name":"Peter Simmons","email":"cabbiepete@gmail.com"},"keywords":["gatsby","gatsby-plugin","hubspot"],"license":"MIT","dependencies":{"node-fetch":"^2.2.0","query-string":"^6.1.0"},"version":"1.0.0","gitHead":"43d775252d18f62f96c822c8593557d727ca88c6","bugs":{"url":"https://github.com/cabbiepete/gatsby-source-hubspot/issues"},"homepage":"https://github.com/cabbiepete/gatsby-source-hubspot#readme","_id":"@cabbiepete/gatsby-source-hubspot@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.11.3","_npmUser":{"name":"cabbiepete","email":"cabbiepete@gmail.com"},"dist":{"integrity":"sha512-7sfnQKpvBCxjs1uJRhs61Ae1AohtfGqOtNLRvSj1FHKhP5yyP6JWeetxFO5wNMdRsmXlmU7fGYxNN4YtGvOnyg==","shasum":"f7e518242e4c1b64231985ff0e0c2e650613c047","tarball":"https://registry.npmjs.org/@cabbiepete/gatsby-source-hubspot/-/gatsby-source-hubspot-1.0.0.tgz","fileCount":5,"unpackedSize":8257,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbnK4nCRA9TVsSAnZWagAASTgQAIgMqzJ9ZkUrjBWGHJ4T\n/BG44Maz9h8Is3ga2J/6UdRd1W4oPpJ7OzFtT81y+zWqBNZYoCiYcduO9H2/\nZ/McdMIMyKqkDQY/Id6mRq/2tMGSIBm10yMrcFevKEgTXbnB9QzK0qDKLi5Q\nsCc3wOUgiK8qnWFzBROH65/KBjiOQnUjwOde5gFjc2zz/XPeFkk7xVEGeuBW\nb770tBEfHETlU3F/QhCiVwU8zl5L7YtliU5Q29jctirovOH1spN6xldONiJj\naOkXkSnPuEPzD8frmLl72TnWljZ18vdSFmaSS+R4E8wWPthZv/+BKJ056zRh\nzKZVqp08IgcDJGj1Gb+hHBogA8ZhnwgCsQaZzAeeZmv8Dx1wL067xKyXP2fG\nIsBOR9OCLTM2J6o3Q1rhsiLKThSFZlQjYlqqz43np5p+EGc3XmLVLf6+tCKw\ngMbQbeBcpn9IEoNPFMSo9Rbtb9JaPy6+N7K8taPNnMGULJPq/N4mr7bDSUZl\n1bKSFKhZ0kgcIvSwr3cqKshogfMWXM2ij3+6hdteX2tjSiIjt4PU+uVrxGeE\nnOe2RVk25dpxS2PH0nW42DwYZDEauE6u/y8kV06XOLlBwPwpG3xCVxfkUMc1\n6HyctZKDLkE39HtaD2E0FnaXuRzLj2/o+nH7LVQaqMntHR6DUbN3zKkJksyi\ngxSq\r\n=g0Qr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2gRsfGJ8XMWwnyZZRt222jFVqH22nJsdr3pfFjKToogIhALbjNzfK6HiCJokMYDHL74C5QgDTm6y0cNjgtS7nbRsJ"}]},"maintainers":[{"name":"cabbiepete","email":"cabbiepete@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-source-hubspot_1.0.0_1536994854540_0.13857629521059978"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-15T07:00:54.379Z","1.0.0":"2018-09-15T07:00:54.700Z","modified":"2022-04-04T21:26:55.308Z"},"maintainers":[{"name":"cabbiepete","email":"cabbiepete@gmail.com"}],"description":"Gatsby source plugin","homepage":"https://github.com/cabbiepete/gatsby-source-hubspot#readme","keywords":["gatsby","gatsby-plugin","hubspot"],"repository":{"type":"git","url":"git+https://github.com/cabbiepete/gatsby-source-hubspot.git"},"author":{"name":"Peter Simmons","email":"cabbiepete@gmail.com"},"bugs":{"url":"https://github.com/cabbiepete/gatsby-source-hubspot/issues"},"license":"MIT","readme":"# gatsby-source-hubspot\n\nThis source plugin for Gatsby will make posts from a Hubspot blog available in GraphQL queries.\n\n## Inspired by version from\n\n\"Lewis Robinson <lewisvrobinson@gmail.com>\"\n\n## Installation\n\n```sh\n# Install the plugin\nnpm install @cabbiepete/gatsby-source-hubspot\n```\n\nIn `gatsby-config.js`:\n\n```js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: 'gatsby-source-hubspot',\n      options: {\n        key: 'YOUR_HUBSPOT_API_KEY'\n      }\n    }\n  ]\n};\n```\n\n## TODO\n\n- Get topics https://api.hubapi.com/blogs/v3/topics?hapikey=b871c468-42ae-489c-82a1-aa0818027e2b&created__gt=1364424600000\n\nAnd merge them onto the blog posts based on tag_ids\n\n- Work out a way for \"featured\" blog posts to be part of featured on home page.\n\n**NOTE:** More information on [Hubspot authentication](https://developers.hubspot.com/docs/methods/auth/oauth-overview). \n\n## Filter Options\n\nThe `filter` options for this plugin mirror the [“Optional query string filters & options”](https://developers.hubspot.com/docs/methods/blogv2/get_blog_posts). Please review those docs for more details.\n\n| Parameter name\t    | Description\n|---------------------|-----------------------------------------------------------------------------------\n| `limit`             | The number of items to return. Defaults to 20\n| `offset`            | The offset set to start returning rows from. Defaults to 0.\n| `archived`          | Returns the posts that match the boolean lookup (e.g. archived=false returns all posts currently not archived).\n| `blog_author_id`    | Returns the posts that match a particular blog author ID value.\n| `campaign`          | Returns the posts that match the campaign guid. The campaign guid can be found in the campaign dashboard URL (e.g. https://app.hubspot.com/campaigns/:portal_id/#/details/:campaign_guid).\n| `content_group_id`  | Returns the posts that match the blog guid. The blog guid can be found in the blog dashboard URL (e.g. https://app.hubspot.com/blog/:portal_id/dashboard/:blog_guid).\n| `created`           | Returns the posts that match a particular created time value. Supports exact, range, gt, gte, lt, lte lookups.\n| `deleted_at`        | Returns the posts that match a particular deleted time value. Supports exact, gt, gte, lt, lte lookups.\n| `name`              | Returns the posts that match the name value. Supports exact, contains, icontains, ne lookups.\n| `slug`              | Returns the posts that match a particular slug value.\n| `updated`           | Returns the posts that match a particular updated time. Supports exact, range, gt, gte, lt, lte lookups.\n| `state`             | DRAFT, PUBLISHED, or SCHEDULED.\n| `order_by`          | Return the posts ordered by a particular field value. Blog posts can currently only be sorted by publish_date. Use a negative value to sort in descending order (e.g. order_by=-publish_date).                                                                                                                                                                                            |\n\n### Example Filter Option Configuration\n\n```js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: 'gatsby-source-hubspot',\n      options: {\n        key: process.env.HUBSPOT_API_KEY,\n        filters: {\n          limit: 10,\n          state: 'PUBLISHED',\n          offset: 2\n        }\n      }\n    }\n  ]\n};\n```\n\n## Querying Hubspot Posts\n\nOnce the plugin is configured, two new queries are available in GraphQL: `allHubspotPost` and `HubspotPost`.\n\nHere’s an example query to load 10 posts:\n\n```gql\nquery PostQuery {\n  allHubspotPost(limit: 10) {\n    edges {\n      node {\n        id,\n        title,\n        body,\n        state,\n        author {\n          id\n          avatar,\n          name,\n          full_name,\n          bio,\n          email,\n          facebook,\n          google_plus,\n          linkedin,\n          twitter,\n          twitter_username,\n          website,\n          slug\n        },\n        feature_image {\n          url,\n          alt_text\n        },\n        meta {\n          title,\n          description\n        },\n        summary,\n        published,\n        updated,\n        created,\n        slug\n      } \n    }\n  }\n}\n```\n\nSee the [Hubspot COS Blog Post API docs](https://developers.hubspot.com/docs/methods/blogv2/get_blog_posts) or the GraphiQL UI for info on all returned fields.\n","readmeFilename":"README.md"}