Reputation: 14745
We're trying to retrieve calendar events using a Google Service Account.
We followed the steps to create a Google Service Account for authentication and downloaded the auth.json
file. According to the Google docs it is sufficient to set an env
variable:
GOOGLE_APPLICATION_CREDENTIALS='./auth.json'
<script setup lang="ts">
import { google } from 'googleapis'
const calendar = google.calendar('v3')
To avoid the warning 'Module "stream" has been externalized for browser compatibility. Cannot access "stream.prototype" in client code.' we had to enable the nodePolyfills for Vite.
At this point we get the errors:
[Vue Router warn]: uncaught error during route navigation
TypeError: Cannot read properties of undefined (reading 'slice') at node_modules/browserify-sign/node_modules/readable-stream/lib/_stream_writable.js (googleapis.js?v=266dd155:30236:85)
We're a bit at a loss here on how to get the authentication working to retrieve calendar events. We do need a Service Account because we need to avoid the user consent screen.
Upvotes: 0
Views: 38