Skip to content

Backport: feat(provider/google-vertex): allow overriding Vertex Anthropic auth token generation#14869

Merged
gr2m merged 1 commit intorelease-v5.0from
backport-14857-to-release-v5.0
Apr 30, 2026
Merged

Backport: feat(provider/google-vertex): allow overriding Vertex Anthropic auth token generation#14869
gr2m merged 1 commit intorelease-v5.0from
backport-14857-to-release-v5.0

Conversation

@R-Taneja
Copy link
Copy Markdown
Contributor

Backport of #14857 to `release-v5.0`.

The v6 backport (#14861) is already merged. This brings the same change to v5 so the option is available across all live branches the AI Gateway depends on.

Change

Adds optional `generateAuthToken` setting on `createVertexAnthropic` (edge + node). When provided, the SDK uses it instead of the default OAuth exchange. Default behavior unchanged.

```ts
createVertexAnthropic({
project: '...',
location: '...',
generateAuthToken: async () => myCustomToken(),
});
```

Tests

29 tests across edge + node, including merge order, fresh-call semantics, error propagation, user-header override, and (node-only) null return.

Risk

Purely additive. No breaking changes.

…token generation

Backport of #14857 to release-v5.0.

Adds an optional `generateAuthToken` setting to `createVertexAnthropic`
(both edge and node variants). When provided, the SDK calls this function
instead of performing the default OAuth exchange. Default behavior is
unchanged.

Useful for tests, custom auth providers, and proxy/relay scenarios where
the caller supplies the auth token directly.
@gr2m gr2m merged commit a8ff5b9 into release-v5.0 Apr 30, 2026
20 checks passed
@gr2m gr2m deleted the backport-14857-to-release-v5.0 branch April 30, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants