Skip to content

Conversation

@Tehnix
Copy link

@Tehnix Tehnix commented Oct 24, 2025

Problem

I ran into an issue instrumenting the Gemini SDK with PostHog since I'm using Vertex AI and that doesn't support authentication via API Key, but instead via googleAuthOptions.

This config option wasn't exposed, so typescript would fail, but since all options are already passed directly into the Gemini client for initialization, it was really just a type issue and not any other code changes required.

I've extended the config options using the client's GoogleGenAIOptions, which should ensure that changes to the Gemini SDK in the future are immediately exposed and available to consumers using the @posthog/ai wrapper.

Relevant thread in the PostHog docs https://posthog.com/questions/vertex-ai-support

Changes

Extended the Gemini wrappers MonitoringGeminiConfig config with GoogleGenAIOptions which ensures all client configuration is available, and unblocks Vertex AI usage.

Release info Sub-libraries affected

Libraries affected

  • All of them
  • posthog-js (web)
  • posthog-js-lite (web lite)
  • posthog-node
  • posthog-react-native
  • @posthog/react
  • @posthog/ai
  • @posthog/nextjs-config

Checklist

  • Tests for new code
  • Accounted for the impact of any changes across different platforms
  • Accounted for backwards compatibility of any changes (no breaking changes!)
  • Took care not to unnecessarily increase the bundle size

If releasing new changes

  • Ran pnpm changeset to generate a changeset file
  • Added the "release" label to the PR to indicate we're publishing new versions for the affected packages

@vercel
Copy link

vercel bot commented Oct 24, 2025

@Tehnix is attempting to deploy a commit to the PostHog Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@posthog-bot
Copy link
Collaborator

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@Tehnix
Copy link
Author

Tehnix commented Nov 5, 2025

This is still very much relevant, I'm running a locally patched version of @posthog/ai currently that adds this in order to use Gemini with Vertex AI

@posthog-bot posthog-bot removed the stale label Nov 5, 2025
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