diff --git a/src/web/_web_auth.ts b/src/web/_web_auth.ts index 8522404b0..521abf1fa 100644 --- a/src/web/_web_auth.ts +++ b/src/web/_web_auth.ts @@ -17,14 +17,16 @@ export class WebAuth implements Auth { return; } - if (this.apiKey.startsWith('auth_tokens/')) { - throw new Error('Ephemeral tokens are only supported by the live API.'); - } - // Check if API key is empty or null if (!this.apiKey) { throw new Error('API key is missing. Please provide a valid API key.'); } + + if (this.apiKey.startsWith('auth_tokens/')) { + throw new Error('Ephemeral tokens are only supported by the live API.'); + } + + headers.append(GOOGLE_API_KEY_HEADER, this.apiKey); } }