@forloopy/googleapis is an open-source JavaScript library, built with loose TypeScript (with plans to include comprehensive types and definitions in the future), designed for seamless interaction with Google APIs. It simplifies the process of granting Google users access to Google Drive and is both free and easy to use. Additional features are planned for future updates.
- Automatically grant a Google user access to Google Drive.
- Lightweight and easy-to-integrate API.
- Open source and free to use.
Install the package using npm:
npm install @forloopy/googleapis
Here’s a basic example of how to use googleapis with the ES module import syntax:
// Initiate
import GoogleAPIs from '@forloopy/googleapis';
const googleapis = new GoogleAPIs({
serviceAccount: '<GOOGLE_SERVICE_ACCOUNT>'
});
const { data, error } = await googleapis.drive.addUser({
role: 'reader',
email: '<EMAIL_ADDRESS>',
target: '<FILE_OR_FOLDER_ID>'
});
if (data?.permission?.id) {
console.log( data )
}
else {
console.log( error )
}
const { data, error } = await googleapis.drive.removeUser({
email: '<EMAIL_ADDRESS>',
target: '<FILE_OR_FOLDER_ID>'
});
if (data) {
console.log( data )
}
else {
console.log( error )
}
Coming soon...
Coming soon...
At this time, this project isn't accepting contributions.
This project is licensed under the MIT License.