{"_id":"@adapttive/gridsome-source-google-sheets","name":"@adapttive/gridsome-source-google-sheets","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@adapttive/gridsome-source-google-sheets","author":{"name":"Spencer Wallace","email":"spencer.wallace@outlook.com"},"contributors":[{"name":"Milind Singh","email":"milind7@live.com"}],"version":"1.0.0","description":"Gridsome source plugin for google sheets","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/adapttive/gridsome-source-google-sheets.git"},"bugs":{"url":"https://github.com/adapttive/gridsome-source-google-sheets/issues"},"homepage":"https://github.com/adapttive/gridsome-source-google-sheets.git","license":"MIT","keywords":["gridsome","gridsome-plugin","gridsome-source","google-sheets"],"dependencies":{"googleapis":"^100.0.0"},"devDependencies":{"prettier":"^1.17.1"},"gitHead":"a17425d653b7ba071e23287558c9e6ceeb98e41e","_id":"@adapttive/gridsome-source-google-sheets@1.0.0","_nodeVersion":"14.19.0","_npmVersion":"8.10.0","dist":{"integrity":"sha512-qWollNy7qkWTT8CxXPwe2W/s16gsAg7Tb+Oi4gaC/FngADnwP4PjBFIqpkljOKCJzx0U//BwrZ003ohrrJpe0Q==","shasum":"267601a9d1649c4da45feeee80ee49075938501a","tarball":"https://registry.npmjs.org/@adapttive/gridsome-source-google-sheets/-/gridsome-source-google-sheets-1.0.0.tgz","fileCount":9,"unpackedSize":10437,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTRE5H3Z9c+2LtNJxiZcpY6hA7gM0fzutKjbkMiBLhnAiAz5aybaNEjtbuESunITsDrm/8k+Y2IRk4A1nNBjJJWkQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih70SACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcvQ/5AVExqHWxEe3fTbqS/s7QGLyGAN7qKq/qAeb3xnSC9S8dagqy\r\nyviY5awBZoRacgAbb+ASz86us0AhUrdc1jjnrISIfaZVYoHS4D5ZuY6bjcdn\r\nlCOXN2XkGCcVOG21djDoZQsCzIF2C+J/dFNlrH1VCqVcm9EHIi+WrT6KZ2ra\r\nq3HSpEuNj8cDqNr7A6GPb21lvtSsELY+ctJEHH7xvMcbt7DynPMrrA61IcY4\r\nbAjNAHCcl9TO63iQjDNbBFFX6ihlxyHU0kJja0POc1glrkwOZtWA9i1XWQrI\r\nTn4fPjPbeE4VTok9T3TGwR3vglMhySks4TXM3AaX87Uq0qKsntZnYqa2zr0n\r\nlY6MzLlpfJKa6bPZs8nggmhrjlidUOhDxXn9YICu2SiRa5GeiNw3Qzb6hu5w\r\n9oPB7BuFBywPH+Q9JKHjCPU8UDgA3o/HvUKgOdVCSUycoduQrdrxpTirr2IT\r\n33yhJ3u+hcIMEdDdk6ndwsdNfht4LmOz/PkikgoQ34NjYtM4N39d6ckW1oBu\r\nB7PO3DQdO/+pvkDkjaBEXDb6EwQGbW781u9PoXUFdl/BRApk0wL9/vZC8rXo\r\n851rr/ILmq+wwEki/Je60C1WHwhkte9w2kZLmXYD8QdjKXlUe3Kfn1F0vhBu\r\nPbG5acNTuIxKcm0gkG3QMRkLKxbNMZ1/8XU=\r\n=hk5p\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"milindsingh","email":"milind7@live.com"},"directories":{},"maintainers":[{"name":"milindsingh","email":"milind7@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gridsome-source-google-sheets_1.0.0_1653062930471_0.7047104494573833"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-20T16:08:50.420Z","1.0.0":"2022-05-20T16:08:50.711Z","modified":"2022-05-20T16:08:50.858Z"},"maintainers":[{"name":"milindsingh","email":"milind7@live.com"}],"description":"Gridsome source plugin for google sheets","homepage":"https://github.com/adapttive/gridsome-source-google-sheets.git","keywords":["gridsome","gridsome-plugin","gridsome-source","google-sheets"],"repository":{"type":"git","url":"git://github.com/adapttive/gridsome-source-google-sheets.git"},"contributors":[{"name":"Milind Singh","email":"milind7@live.com"}],"author":{"name":"Spencer Wallace","email":"spencer.wallace@outlook.com"},"bugs":{"url":"https://github.com/adapttive/gridsome-source-google-sheets/issues"},"license":"MIT","readme":"# Gridsome Source for Google Sheets v2\n\n![npm](https://img.shields.io/npm/dt/@adapttive/gridsome-source-google-sheets)\n![npm](https://img.shields.io/npm/v/@adapttive/gridsome-source-google-sheets)\n![github](https://img.shields.io/github/package-json/v/adapttive/gridsome-source-google-sheets)\n<br>\n\n> This is an updated fork of [this repository](https://github.com/spenwall/gridsome-source-google-sheets).\n\nGridsome source plugin for google sheets, handles multiple pages or sheets!\n\n## Requirements\n\nGridsome: >0.7.0\n\n## Install\n\n```bash\nyarn add @adapttive/gridsome-source-google-sheets\n```\n\nnpm\n\n```bash\nnpm install @adapttive/gridsome-source-google-sheets\n```\n\n## How to use\n\nYou will need to generate a google api key [here](https://console.developers.google.com/apis/credentials). The Spreadsheet ID can be found on the sheets url. You will also need to make your spreadsheet viewable to the public to use the api credentials.\n\n```js\nmodule.exports = {\n  siteName: \"Gridsome\",\n  plugins: [\n    {\n      use: \"gridsome-source-google-sheets\",\n      options: {\n        apiKey: \"GOOGLE_API_KEY\",\n        spreadsheets: [\n          {\n            spreadsheetId: \"SPREADSHEET_ID\",\n            sheets: [\n              {\n                sheetName: \"SHEET_NAME\", // Example: \"Sheet1\"\n                collectionName: \"COLLECTION_NAME\" // Example: \"Users\" (Must be unique)\n              }\n            ]\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n### How to Use Multiple Spreadsheets\n\n```js\noptions.spreadsheets: [\n  {\n    spreadsheetId: 'SPREADSHEET_ID_1',\n    sheets: [\n      {\n        sheetName: 'SHEET_NAME', // Example: \"Sheet1\"\n        collectionName: 'COLLECTION_NAME', // Example: \"Users\" (Must be unique)\n      },\n    ],\n  },\n  {\n    spreadsheetId: 'SPREADSHEET_ID_2',\n    sheets: [\n      {\n        sheetName: 'SHEET_NAME', // Example: \"Sheet2\"\n        collectionName: 'COLLECTION_NAME', // Example: \"Projects\" (Must be unique)\n      },\n    ],\n  },\n]\n```\n\n### How to Use Multiple Sheets from the Same Spreadsheet\n\n```js\noptions.spreadsheets: [\n  {\n    spreadsheetId: 'SPREADSHEET_ID',\n    sheets: [\n      {\n        sheetName: 'SHEET_NAME', // Example: \"Sheet1\"\n        collectionName: 'COLLECTION_NAME', // Example: \"Projects\" (Must be unique)\n      },\n      {\n        sheetName: 'SHEET_NAME', // Example: \"Sheet2\"\n        collectionName: 'COLLECTION_NAME', // Example: \"Users\" (Must be Unique)\n      },\n    ],\n  },\n]\n```\n\n### Example query on page template\n\nThis plugin assumes that the first row in your table is the column name. In this example the 2 columns that exist are named `title` and `body`, with `id` being a key that this plugin generates automatically.\n\n```js\n<page-query>\n  query {\n    allCollectionName {\n      edges {\n        node {\n          id, // Automatically generated\n          title,\n          body\n        }\n      }\n    }\n  }\n</page-query>\n```\n\n### To use data in page\n\n`$page.allCollectionName.edges` will be an array of each row of your Google Sheet.\n\n```js\n<template>\n    <!--  Example: \"{{ $page.allUsers.edges }}\" -->\n    <div v-for=\"row in $page.allCollectionName.edges\" v-key=\"row.node.id\">\n      {{ row.node.id }}\n    </div>\n</template>\n```\n\n### Using Templates\n\nTo use this in a template first setup the template route in gridsome.config.js\n\n```js\nmodule.exports = {\n  siteName: \"Gridsome\",\n  plugins: [\n    {\n      use: \"gridsome-source-google-sheets\",\n      options: {\n        apiKey: \"GOOGLE_API_KEY\",\n        spreadsheets: [\n          {\n            spreadsheetId: \"SPREADSHEET_ID\",\n            sheets: [\n              {\n                sheetName: \"SHEET_NAME\", // Example: \"Sheet1\"\n                collectionName: \"COLLECTION_NAME\" // Example: \"Users\" (Must be unique)\n              }\n            ]\n          }\n        ]\n      }\n    }\n  ],\n  templates: {\n    collectionName: [\n      {\n        path: \"/somePath/:id\", // Example: \"/user/:id\"\n        component: \"./src/templates/collectionName.vue\" // Example: \"./src/templates/users.vue\"\n      }\n    ]\n  }\n}\n```\n\n### Example template in src/template/collectionName.vue\n\n```html\n<template>\n  <layout>\n    <!--  Example: \"{{ $page.users.title }}\" -->\n    <div>{{ $page.collectionName.title }}</div>\n\n    <!--  Example: \"{{ $page.users.body }}\" -->\n    <div>{{ $page.collectionName.body }}</div>\n  </layout>\n</template>\n```\n\n```js\n<page-query>\nquery ($id: ID!) {\n  collectionName(id: $id) { // Example: \"users(id: $id)\"\n    title,\n    body\n  }\n}\n</page-query>\n```\n","readmeFilename":"README.md"}