Install

npm install @agentic/google-drive googleapis google-auth-library

Example Usage

import { GoogleDriveClient } from '@agentic/google-drive'
import { GoogleAuth } from 'google-auth-library'
import { google } from 'googleapis'

const auth = new GoogleAuth({ scopes: 'https://www.googleapis.com/auth/drive' })
const drive = google.drive({ version: 'v3', auth })
const client = new GoogleDriveClient({ drive })

const result = await client.listFiles()

const file = result.files[0]!
const metadata = await client.getFile({ fileId: file.id })
const content = await client.exportFile({
  fileId: file.id,
  mimeType: 'application/pdf'
})