I have the sample (https://github.com/actions-on-google/smart-home-nodejs/blob/master/src/auth-provider.ts) of GoogleHome running 100% on GCP, only lacking 0Auth2 authentication and the Auth0 offered service seemed like a good solution, but there is no example in TypeScript.
Actions on Google is configured correctly and I can log in through Auth0, but I can not integrate into the example.
After much research, I keep walking in circles. At least importing from the library does not fail.
import * as express from 'express'
import * as util from 'util'
import { Headers } from 'actions-on-google'
import createAuth0Client from '@auth0/auth0-spa-js';
import * as Firestore from './firestore'
/**
* A function that gets the user id from an access token.
* Replace this functionality with your own OAuth provider.
*
* @param headers HTTP request headers
* @return The user id
*/
export async function getUser(headers: Headers): Promise<string> {
const authorization = headers.authorization
const accessToken = (authorization as string).substr(7)
return await Firestore.getUserId(accessToken)
} ...