I'm not understand either the Google docs or the code documentation for how to use an access token with a method from the googleapis people module.
My use case is to get a user's phone number for account creation in my application. I accept the access token and validate it and check its scope, as outlined in the Google documentation here: Using OAuth 2.0 to Access Google APIs
Step 4 in that document says "Send the access token to an API" - and then they outline the process for including it in a header. But I'm using the NodeJS SDK, so I'm trying to figure out how to pass the access token to either my people constructor or the method proper.
Starting with the method proper, my parameters seem to be personFields, resourceName, and sources - none of which are suitable for the access token.
So I looked at the people constructors:
export declare function people(version: 'v1'): people_v1.People;
export declare function people(options: people_v1.Options): people_v1.People;
I note that the second extends GlobalOptions with the version property. GlobalOptions extends MethodOptions (and so on) with the auth property. Which seems right (at least in name). I see that the auth property's type is:
auth?: GoogleAuth | OAuth2Client | BaseExternalAccountClient | string;
Of these types, it seems like string would be my target - but there's no good documentation as to what it wanted there.
What am I missing - where do I input this access token? In the people_v1 section that details the people_v1 options, I see there's an interface called StandardParameters - and access_token is right there! But I can't figure out WHY it's right there or how to use it.