Skip to content

Latest commit

 

History

History
45 lines (26 loc) · 1.23 KB

File metadata and controls

45 lines (26 loc) · 1.23 KB

POC Google Docs Read

Overview

This is a simple proof of concept to read a Google Docs document using the Google Docs API.

Prerequisites

Dependencies

Google Cloud Project Setup

  1. Create a new project in the Google Cloud Console.

  2. Enable the Google Docs API for the project. (Click here to see how to enable an API in GCP)

  3. Create a new service account for the project. (No need to configure any roles since google apps (docs, sheets, etc) are not supported by the IAM system.)

  4. Download the service account credentials as a JSON file.

  5. Share the Google Docs document with the service account email address. (The service account email address can be found in the JSON file.)

Usage

  1. Set the GCP environment variables.
cp .env.example .env
  1. Fill in the .env file with the service account credentials.

  2. Run the script.

bun i
bun run index.ts

References