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

google-cloud-edge-service-account-auth

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-cloud-edge-service-account-auth

Google Cloud API service account auth helpers for the Edge runtime

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

google-cloud-edge-service-account-auth

This library was created for use in Edge Runtimes (such as Cloudflare Workers and Vercel Edge) to interact with the Google Cloud APIs using a service account JSON.

Usage

import { GoogleAuthClient } from 'google-cloud-edge-service-account-auth';

const authClient = new GoogleAuthClient(
  {
    client_email: '...',
    private_key: '...',
  },
  { fetch }
);

const { access_token } = await authClient.authenticate([
  'https://www.googleapis.com/auth/devstorage.full_control',
]);

await fetch('https://storage.googleapis.com/storage/v1/b/bucketName/o/', {
  headers: [['Authorization', `Bearer ${access_token}`]],
});

Configuration Options

The 2nd constructor argument accepts a few configuration options as explained below:

namedescription
fetchUsed to define the fetch implementation
authCacheShould implement a GoogleAuthCache instance (exported by the library). Can be used to cache tokens in a third party library or service.
expiryThresholdSecondsUsed to determine when to refresh tokens (defaults to 60)

Keywords

FAQs

Package last updated on 03 Aug 2023

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