New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

googleapi-library

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googleapi-library

Google APIs project for Realtime Database and Drive v3 using fetch

  • 1.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
273
Maintainers
0
Weekly downloads
 
Created
Source

GoogleAPI Library

This project provides a simple interface for interacting with Google Drive and Firebase Realtime Database using only fetch requests, without setting up an HTTP server.

Engines

  • NodeJS version >= 18

Installation

npm install googleapi-library

Usage

Authentication

To use this library, you need to provide Google service account credentials.

import { GoogleAuth } from "googleapi-library";

const credentials = {
  client_email: "your-service-account@your-project.iam.gserviceaccount.com",
  private_key: "your-private-key"
};

const googleAuth = new GoogleAuth(credentials);

Google Drive

Initialize Google Drive
const drive = googleAuth.drive("your-folder-id");
Upload a File
const fileId = await drive.create(myFile);
console.log("Uploaded file ID:", fileId);
Delete a File
const success = await drive.remove("file-id");
console.log("File deleted:", success);
List Files
const files = await drive.filter();
console.log("Files:", files);

Firebase Realtime Database

Initialize Database
const database = googleAuth.database("https://your-database.firebaseio.com");
Retrieve Data
const data = await database.findAll("/path");
console.log("Data:", data);
Insert or Update Data
await database.create("/path", { key: "value" });
Delete Data
await database.remove("/path");
Query Data
const result = await database.query("/users", { orderBy: "name", equalTo: "John" });
console.log("Query Result:", result);

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 21 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc