What is the difference between the two Google JS clients: platform.js vs api.js? What is the difference between the two Google JS clients: platform.js vs api.js? javascript javascript

What is the difference between the two Google JS clients: platform.js vs api.js?


The functionality in platform.js is a superset of the functionality in api.js. If you are using both the sheets APIs and the sign-in API, platform.js will suffice, you needn't load both. ~https://github.com/google/google-api-javascript-client/issues/658

platform.js is a platform detection library that works on nearly all JavaScript platforms.platform.js is for informational purposes only & not intended as a substitution for feature detection/inference checks.platform.js is Google's library for accessing the Google Plus API.

Platform.js is part of the BestieJS “Best in Class” module collection. This means we promote solid browser/environment support, ES5+ precedents, unit testing, & plenty of documentation.

Using the platform.js library, it becomes very easy for us to detect the browser just by writing one line of JavaScript code. You can get this library on GitHub. All the complicated code is already written in this library and we just have to use it.


The answer of Neha Jha is right for your question, however, I wanna update the news from Google. They announce to discontinue Google Sign-In JavaScript Platform Library for web and they ask us to migrate to the new thing before 31/03/2023.


platform.js is the Google Plus API, which has been shut down march 7th 2019.

api.js is the Google API Client Library for JavaScript "The Google API Client Library for JavaScript is designed for JavaScript client-application developers. It offers simple, flexible access to many Google APIs."

Use api.js for your use case. See this.