This is is really hard for me to figure out because there are so many different repos names and different npm names and different python repo / pip names - and completely without any schema. I even tried to ask Gemini 2.5 pro and you made it so confusing that even gemini providing some misleading informations. Please write in repo at the top some explanation for ALL repos. Deprecate repos that are not supposed to be used as well. Write pros and cons of each package.
but redirects with links to “after installing the relevant package” and in this link I’m instructed to do:
npm install @google/genai
Then I have repo “github . com/googleapis/js-genai” and it says “TypeScript/JavaScript SDK for Gemini and Vertex AI. [PREVIEW]”
On the other hand Gemini 2.5 pro suggest this is old repo and I should use @google/generative-ai but not clue where this repo is hosted then?
Then there is repo: GoogleCloudPlatform/generative-ai but it seems its only for samples.
It’s amazingly frustrating. You have really great models but imho really have to work on better documentation (I totally hate you docs template for all projects maybe trauma for using it with tensorflow and plenty of other projects) - its so hard to figure out sidemap and navigation because there are like 3 different breadcrumbs and navigation bars. Onboarding also should be better.
PS BIG PAPER CUT: Also after writing this whole message and putting effort I couldn’t made post ( you only allow to provide 2 links for new users ) - its so annoying.
Thanks for reply. Please then update Google AI Studio to not recommend using old package then. Also I think better to clarify explicitly if its works only on Node.js or also in Browser Web or WebView as well. Documentation sometimes says Node.js sometimes Javascript sometimes Typescript. I did try porting some code from live API to use in react native and it seems you need some specific implementation of WebSocket
Those recommendations are based on what is generally available. As you might have noticed the new genai package is not yet available for all programming languages or for some it’s still in Preview only. See the new JavaScript/Typescript package for example.
I’m not into that kind of SDK at all, and I’m maintaining a Gemini SDK for .NET (C#) on my own solely developed on the REST API provided by the Gemini API.
FYI, those new, unified genai packages were started back in October/November 2024 only, and the teams at Google are adding new programming languages over time. The JS/TS package was only announced back in March 2025.
Providing feedback instead of complaining might help to improve the package faster. Just saying…
See other (web) developers, like those using PHP, C#, etc., there’s no Gemini SDK available.
Thanks, sorry for the rant. I think this is useful information that you provided and google stuff reading this should include it as part of README of both repos at the top. Also Google AI studio when showing generated code (for JS/TS) should either use new API (since they also link to docs that only document new API) or also have a comment that this is old API and in API is in not production ready (preview) - since right now is very misleading when they generate old API and link to new API.
If I’m not mistaken there’s a straight feedback option in AI Studio. Tell the responsible team.
Also, the new genai package for JS/TS is still under preview hence I suspect that’s the reason it’s not offered under “Get Code” just yet.
Yes, it’s a mess. Will it get better, yes definitely. Provide feedback and tell the team what’s painful.