如何连接到谷歌驱动器和创建谷歌文档与流星

How to connect to Google Drive and create Google Docs with meteor?

本文关键字:谷歌 驱动器 创建 文档 流星 何连接 连接      更新时间:2023-09-26

我的web应用程序使用Meteor.loginWithGooglerequestPermissions: ['email']登录用户。

我想连接到一些用户的Google Drive并创建一些Google Docs。

1。得到许可

如何获得访问用户Google Drive的权限?

我应该用更多的权限调用Meteor.loginWithGoogle函数吗?比如:

requestPermissions: ['email https://www.googleapis.com/auth/drive.file'] ?

每次我想访问用户的Google Drive时,我应该这样做吗?

2。列出Google Docs并创建新的

如何列出和创建新的Google Docs?

谢谢你的帮助

1/用这样的字符串分隔权限:

Meteor.loginWithGoogle({
  forceApprovalPrompt: true,
  requestOfflineToken: true,
  requestPermissions: ['email', 'https://www.googleapis.com/auth/drive.file']);

使用requestOfflineToken,即使用户没有连接,也可以访问它。

2/使用Google api。或者使用类似https://github.com/percolatestudio/meteor-google-api

的包