Node.js samples for Google Workspace APIs docs
This repository contains Node.js samples for Google Workspace APIs.
-
Install Node.js.
-
Install
pnpmby runningnpm install -g pnpmor see additional options at https://pnpm.io/installation.pnpmis used withturborepoto better handled the many packages in the repository. -
Create a Service Account
Before running tests, create a service account and download
application_credentials.jsonin this directory.To create a service account, follow these steps:
- Navigate to the Google Cloud Console API Dashboard
- Enable APIs for products you'd like to test snippets for like Slides or Drive.
- Create a service account key under Credentials.
- After creating a new JSON Service account key without a role and set the env variable
SERVICE_ACCOUNT_CREDENTIALS=some/path/to/application_credentials.json.
-
pnpm test -
pnpm lint -
Delete service account file.
-
pnpx codemod pnpm/catalogto add package dependencies to the catalog. -
pnpm -r -L updateto update all package depencies to the latest version.
Contributions welcome! See the Contributing Guide.