{"_id":"@alehkudrevich/react-google-drive-picker","name":"@alehkudrevich/react-google-drive-picker","dist-tags":{"latest":"1.2.0"},"versions":{"1.2.0":{"name":"@alehkudrevich/react-google-drive-picker","version":"1.2.0","description":"React google drive picker api","types":"./dist","main":"./dist/index.js","scripts":{"build":"tsc","watch":"tsc -w","dev":"nodemon ./dist/index.js","lint":"eslint 'src/**/*.{js,ts,tsx}' --fix","format":"prettier --write ./src/*"},"author":{"name":"Jose-cd"},"repository":{"type":"git","url":"git+https://github.com/Jose-cd/React-google-drive-picker.git"},"bugs":{"url":"https://github.com/Jose-cd/React-google-drive-picker/issues"},"license":"MIT","keywords":["react","google","drive","picker"],"devDependencies":{"@types/react":"^17.0.5","@typescript-eslint/eslint-plugin":"^4.23.0","@typescript-eslint/parser":"^4.23.0","eslint":"^7.26.0","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.23.2","eslint-plugin-jsx-a11y":"^6.4.1","eslint-plugin-react":"^7.30.0","eslint-plugin-react-hooks":"^4.2.0","nodemon":"^2.0.7","prettier":"2.3.2","prettier-eslint":"^12.0.0","typescript":"^4.2.4"},"peerDependencies":{"react":">=17.0.0","react-dom":">=17.0.0"},"gitHead":"767e2078ac0ba84f24407b67aa24f7713fe6946a","homepage":"https://github.com/Jose-cd/React-google-drive-picker#readme","_id":"@alehkudrevich/react-google-drive-picker@1.2.0","_nodeVersion":"14.20.1","_npmVersion":"6.14.17","dist":{"integrity":"sha512-u4VWBMOCy56J5L8RFGtf1LnGswMhov1yptNu+ICiPxIzsl9iH5O9zQ5YbGu53iW/H9qxk/yYARZ2ymOj2Kz3ug==","shasum":"267d52567efd1906ff7ceb89513cfd3efe82aff6","tarball":"https://registry.npmjs.org/@alehkudrevich/react-google-drive-picker/-/react-google-drive-picker-1.2.0.tgz","fileCount":21,"unpackedSize":40175,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEcHzpw3SEJ9GV0TkFPaop/49NCqCv4DCvmk4K0RDydAIgZp3VT58uMet2GE3+3TVuvRXkRXJjWOeXBjz+g4/ufiE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju90vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeDQ/+Po6htMgl4iU6n3G3wAJb3puGxrkQlJbjCep5AtQfiYfm0uKj\r\n+UPpLtpDns8WiTdPY5REAuyydATJF1eXroIeLQMOkjLB02YLeMwdpR7tsGuF\r\n8FFEPdSRgCLfr+FQA5ucnFCPc9rl8ZW4nYpd/Ui+Hj54SaPakXRm4L5JllS0\r\nmnq0t3mjmcT4/RNyPEI79gG79PsOwOOcFfSpdYIkIf8Wh7U/lE6UwuDWM6yJ\r\nQFg5gp/prKNIXHj4SfojGA1/gFt8npvnj9wCP75mjwMaonu90q0OHL4/Mjg8\r\nS+Z09kTgvmCncXJUgD4HkDvLP4vCHSLPg9RNyFqH3pUTruADQfbvlKRhH6be\r\nmXAK4U9WjOW/hL5c2JUjVbsq93mrpdMfARwccIQUWLV6MjsfP0ab0JZhCkWm\r\n9U+N/x/8u/PeQh7RUxQ8gHYdSbsrGc6xiLbw1CHCJ6h7vu7/Cij4Pxv/XZkb\r\ncOAxPBLBf9dhD1pOWIwua3KMvd5BvjyLHC5tgOqfwbkE+83b9Zxcq7j3H30u\r\n2BM1PpPvKJJ5ROqeBrToLqlxseRBE0Z7b11CAMGDS8Ex8mJ2ugp1RNyFhNSn\r\n33L2WP7OUzbU+axt7X6B4i2XHvimxRsrSeFlhmzva38DM61CBgLQRvc5mR+y\r\n1e/lnmwaHItiA+6aJgekX98j2EwgmAdS+/A=\r\n=62OK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"alehkudrevich","email":"aleh.kudrevich@lunalabs.io"},"directories":{},"maintainers":[{"name":"alehkudrevich","email":"aleh.kudrevich@lunalabs.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-google-drive-picker_1.2.0_1673256239258_0.8217150662736155"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-09T09:23:59.152Z","1.2.0":"2023-01-09T09:23:59.395Z","modified":"2023-01-09T09:23:59.535Z"},"maintainers":[{"name":"alehkudrevich","email":"aleh.kudrevich@lunalabs.io"}],"description":"React google drive picker api","homepage":"https://github.com/Jose-cd/React-google-drive-picker#readme","keywords":["react","google","drive","picker"],"repository":{"type":"git","url":"git+https://github.com/Jose-cd/React-google-drive-picker.git"},"author":{"name":"Jose-cd"},"bugs":{"url":"https://github.com/Jose-cd/React-google-drive-picker/issues"},"license":"MIT","readme":"# React-google-drive-picker\n\nGoogle drive picker\n\n## Description\n\nGoogle drive picker custom hook.\n\n## Getting Started\n\n### Installing\n\nWith npm\n```\nnpm i react-google-drive-picker\n```\nWith yarn\n```\nyarn add react-google-drive-picker\n```\n\n### Usage\n\n```js\nimport  { useEffect } from 'react';\nimport useDrivePicker from 'react-google-drive-picker'\n\n\nfunction App() {\n  const [openPicker, authResponse] = useDrivePicker();  \n  // const customViewsArray = [new google.picker.DocsView()]; // custom view\n  const handleOpenPicker = () => {\n    openPicker({\n      clientId: \"xxxxxxxxxxxxxxxxx\",\n      developerKey: \"xxxxxxxxxxxx\",\n      viewId: \"DOCS\",\n      // token: token, // pass oauth token in case you already have one\n      showUploadView: true,\n      showUploadFolders: true,\n      supportDrives: true,\n      multiselect: true,\n      // customViews: customViewsArray, // custom view\n      callbackFunction: (data) => {\n        if (data.action === 'cancel') {\n          console.log('User clicked cancel/close button')\n        }\n        console.log(data)\n      },\n    })\n  }\n\n\n  \n  return (\n    <div>\n        <button onClick={() => handleOpenPicker()}>Open Picker</button>\n    </div>\n  );\n}\n\nexport default App;\n```\n\n\n## Picker configuration props\n\n## Picker Props\n\n|    params        |   value  |  default value   |          description          |\n|------------------|----------|------------------|-------------------------------|\n| callbackFunction  |function    |  REQUIRED       |Callback function that will be called on picker action |\n|    clientId      |  string  |     REQUIRED     |      Google client id         |\n|    developerKey  |  string  |     REQUIRED     |      Google developer key     |\n|    disableDefaultView  |  boolean  |     false     |      disables default view     |\n|    viewId        |  string  |     DOCS         |         ViewIdOptions         |\n|    viewMimeTypes |  string  |     optional     |Comma separated mimetypes. Use this in place of viewId if you need to filter multiple type of files. list: https://developers.google.com/drive/api/v3/mime-types.|\n|setIncludeFolders|  boolean  |     false        |Show folders in the view items.|\n|setSelectFolderEnabled|boolean|     false       |Allows the user to select a folder in Google Drive.|\n| setOwnedByMe     |  boolean |     false        | Filters the documents based on whether they are owned by the user, or shared with the user. Do not combine this setting with setIncludeFolders. When setIncludeFolders(true) is set, setOwnedByMe is ignored.|\n|   token          |  string  |     optional     | access_token to skip auth part|\n|  multiselect     |  boolean |     false        | Enable picker multiselect     |\n| supportDrives    |  boolean |     false        |    Support shared drives      |\n| showUploadView   |  boolean |     false        |     Enable upload view        |\n| showUploadFolders|  boolean |     false        |Enable folder selection(upload)|\n| setParentFolder  |  string  |     disabled     |  Drive folder id to upload    |\n| customViews      |ViewClass[]|    optional     |  Array of custom views you want to add to the picker|\n| customScopes      |string[]|    ['https://www.googleapis.com/auth/drive.readonly']     |  Array of custom scopes you want to add to the picker|\n| locale           |string    |    en            | List of supported locales https://developers.google.com/picker/docs#i18n|\n\n\n  ## viewId options\n|    option            |         description             |\n|----------------------|---------------------------------|\n|    DOCS            |All Google Drive document types. |\n|  DOCS_IMAGES          |Google Drive photos.             \n|DOCS_IMAGES_AND_VIDEOS |Google Drive photos and videos.  |\n|    DOCS_VIDEOS        |Google Drive videos.             |\n|    DOCUMENTS          |\tGoogle Drive Documents.         |\n|    FOLDERS            |Google Drive Folders.            |\n|    DRAWINGS           |Google Drive Drawings.           |\n|    FORMS              |\tGoogle Drive Forms.             |\n|    PDFS               |PDF files stored in Google Drive.|\n|    SPREADSHEETS       |Google Drive Spreadsheets.       |\n\n## Author\n\n[@Jose medina](https://www.linkedin.com/in/jos%C3%A9-medina-56479a128/)\n\n\n## Acknowledgments\nInspiration, code snippets\n* [sdoomz](https://github.com/sdoomz/react-google-picker)\n* [obonyojimmy](https://github.com/obonyojimmy/react-drive-picker#readme)\n","readmeFilename":"README.md"}