@forloopy/googleapis
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@forloopy/googleapis

@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.


Features

  • Automatically grant a Google user access to Google Drive.
  • Lightweight and easy-to-integrate API.
  • Open source and free to use.

Installation

Install the package using npm:

npm install @forloopy/googleapis

Usage

Here’s a basic example of how to use googleapis with the ES module import syntax:

Import & Initiate

// Initiate
import GoogleAPIs from '@forloopy/googleapis';
const googleapis = new GoogleAPIs({
	serviceAccount: '<GOOGLE_SERVICE_ACCOUNT>'
});

Add Drive User

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 )	
}

Remove Drive user

const { data, error } = await googleapis.drive.removeUser({
 	email: '<EMAIL_ADDRESS>',
 	target: '<FILE_OR_FOLDER_ID>'
});
if (data) {
 	console.log( data )
}
else {
 	console.log( error )	
}

Configuration

Coming soon...

Documentation

Coming soon...

Contributing

At this time, this project isn't accepting contributions.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i @forloopy/googleapis

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

10.7 kB

Total Files

10

Last publish

Collaborators

  • forloopy