Authentication helper for Google Cloud Maps APIs. Manages session-token creation and renewal for both the Photorealistic 3D Tiles API and the 2D Map Tiles API, injecting the API key and session token into outgoing requests.
Properties
apiToken: string
The Google Cloud API key.
autoRefreshToken: boolean
Whether to automatically refresh the session token on 4xx errors.
authURL: string
The endpoint URL used to create or refresh the session token.
sessionToken: string | null
The current session token, or null if not yet established.
sessionOptions: Object | null
Session options passed as the POST body when creating a Map Tiles session.
Methods
new GoogleCloudAuth(
options: {
apiToken: string,
sessionOptions: Object | null = null,
autoRefreshToken: boolean = false
}
)