Google Drive API Library
Manage google drive easily. Support create folders, upload files, download files, searching, etc.. The library is build with Google Drive API v3.
- Create Folders
- Upload Files
- Download Files (as Buffer)
- Powerful file query tools
- Empty Trash
Using Service Account
- Create a Google Cloud Project
- Create Service Account
- Service account details > Choose any service account name > CREATE
- Grant this service account access to project > CONTINUE
- Grant users access to this service account ( > CREATE KEY
- Save the key file into your project
- Enable Drive API
- APIs and Services > Enable APIS AND SERVICES
- Search Google Drive API > Enable
- To access shared folder
- Open the JSON key file, you will find an email firstname.lastname@example.org.
- Go to your Google Drive Folder and shared the edit permission to the email address.
- Create using serviceAccount.json
- Create using client_email and private_key
; // these can be found inside the json file;
- How to generate an oauth token is not covered here
- But you can create one easily via https://developers.google.com/oauthplayground/
- Select Drive API v3 with scopes "https://www.googleapis.com/auth/drive"
- Authorize and get the Access token
- Create using accessToken