platform.js 还是 api.js?谷歌应用程序接口

Yor*_*evi 5 javascript web-applications google-api google-api-js-client

试图了解我应该如何引用静态页面 Web 应用程序的 google api。我很困惑。

  1. 我不确定完整的文档在哪里,因为我已经在这个存储库中偶然发现了一些损坏的链接
  2. 这些教程引用了 2 个不同的 url,但似乎与此存储库相关

https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams

<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script>
Run Code Online (Sandbox Code Playgroud)

https://developers.google.com/sheets/api/quickstart/js

<script async defer src="https://apis.google.com/js/api.js"
      onload="this.onload=function(){};handleClientLoad()"
      onreadystatechange="if (this.readyState === 'complete') this.onload()">
Run Code Online (Sandbox Code Playgroud)

有什么区别?应该使用什么网址?有关系吗?应该使用 Node 客户端而不是 Web 来编译它吗?

Yor*_*evi 2

https://github.com/google/google-api-javascript-client/issues/658#issuecomment-692839901

中士发表评论

platform.js 中的功能是 api.js 中功能的超集。这些 API 的文档是正确的。如果您同时使用工作表 API 和登录 API,则 platform.js 就足够了,无需加载两者。你是对的,这没有很好的记录,我们知道这是一个问题。关闭这个,因为在这里跟踪改进文档的工作(这是一个更大的问题)是没有用的。