@advanced-rest-client/google-drive-browser
TypeScript icon, indicating that this package has built-in type declarations

4.0.2 • Public • Published

Google Drive browser for Advanced Rest Client

A file browser for Google Drive.

Renders list view for Google Drive items that the application hosting the element has access to. The access is determined by accessToken generated for specific client id or by apiKey property. Learn more about access in Google Drive API docs.

Authorization

The element does not handle user authentication. The accessToken property has to be set on the element.

Listening for user actions

The element allows the user to pick and open a Google Drive item. When this happens the element downloads content of the file using the same access token and dispatches drive-file custom event. The event contains content and driveId properties.

document.querySelector('google-drive-browser').addEventListener('pick', (e) => {
  const driveId = e.detail;
  console.log(`Selected file: ${driveId}`);
});

Usage

Installation

npm install --save @advanced-rest-client/google-drive-browser

Development

git clone https://github.com/advanced-rest-client/google-drive-browser
cd google-drive-browser
npm install

Running the demo locally

npm start

Running the tests

npm test

Package Sidebar

Install

npm i @advanced-rest-client/google-drive-browser

Weekly Downloads

2

Version

4.0.2

License

Apache-2.0

Unpacked Size

56.4 kB

Total Files

12

Last publish

Collaborators

  • carowright
  • jarrodek
  • twoplustwoone
  • lbauret