Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

A) <script src="https://apis.google.com/js/platform.js"></script> 

versus

B) <script src="https://apis.google.com/js/api.js"></script> 

I am a little bit confused about how to use Google OAuth service, should I use platform script or api script.

like image 471
Humoyun Ahmad Avatar asked Nov 05 '18 02:11

Humoyun Ahmad


People also ask

What is gapi JavaScript?

GAPI is Google's client library for browser-side JavaScript. It's used in Google Sign-in, Google Drive, and thousands of internal and external web pages for easily connecting with Google APIs.

What is platform js?

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.


1 Answers

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.

like image 125
Neha Jha Avatar answered Sep 23 '22 09:09

Neha Jha