简体   繁体   中英

Using Google Cloud Pub/Sub from Chrome extension

In my current project we are already using Google Pub/Sub: cloud.google.com/Pub_Sub‎

Now, we also need to create a Chrome extension, which will be sending some information for each url (of a specific domain). Extension does not need to receive anything. I was wondering if pub/sub is a good idea for this? (is it even possible?) Or should I create a web-service for this.

If it is possible, could someone please point me to any existing application, which does it?

I am new to pub/sub.

The actual publishing probably shouldn't be done through the extension. This is because you'll need to distribute the app and you can't include the credentials you need for authenticating to Cloud Pub/Sub.

Instead, you should create a separate service, perhaps a serverless setup using Cloud Run or Cloud Functions that handle requests from the chrome extension and deals with authentication automatically. Those functions can then publish to Cloud Pub/Sub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM