The access token that Firebase Auth gives can be substituted for the OAuth2Client you'd normally use in the Node.js server:
const result = await signInWithPopup(auth, provider);
const credential = GoogleAuthProvider.credentialFromResult(result);
const token = credential?.accessToken;
const studentData = await classroom.courses.students.list({
courseId,
auth: token,
});
This is odd because when I try to use the access token I get from passport-google-oauth2 it throws an error.
It also stopped working after the first time because the googleapis package is meant for server environments from what I can understand, and Vite started throwing errors.
How to implement Google API with React, Redux and Webpack
Manually typing the fetch request is best solution for now.