通过云功能访问“ Chrome Web Store API”

时间:2018-11-12 19:42:40

标签: firebase google-chrome-extension google-cloud-platform google-cloud-functions chrome-web-store

我想从Cloud Function访问“ Chrome Web Store API”。

https://developer.chrome.com/webstore/api_index#Licenses

为什么? 我们正在制作chrome扩展程序,并希望检查用户是否在网上商店中购买了扩展程序(即许可证)。可从Chrome Web Store API获得许可信息。我们可以直接从扩展程序向Web Store API发出请求,但是随后弹出一个(丑陋的)弹出窗口,要求用户代表他们访问API,这是不理想的。我们希望改为创建一个Cloud Function端点,该端点在发送userID时将根据用户是否具有有效许可证来响应true或false。 Cloud Function应该能够通过以下URL获取任何用户的许可证数据:(https://www.googleapis.com/chromewebstore/v1.1/licenses/ $ appID / $ userID)。

我已尝试挖掘有关如何执行此操作的示例。我想我需要与Google API客户端库的Cloud Function版本等效的功能,该版本可以通过oath2或服务帐户来处理身份验证。.但是即使那样,我仍然看不到为GET请求设置URL的方法。

非常感谢任何指示或建议。

0 个答案:

没有答案