serverless-google-cloudfunctions icon indicating copy to clipboard operation
serverless-google-cloudfunctions copied to clipboard

Add support for Database events

Open fantapop opened this issue 8 years ago • 2 comments

It would be great if this supported firebase real time db triggers:

https://firebase.google.com/docs/reference/functions/functions.database

fantapop avatar Oct 12 '17 05:10 fantapop

Hello @fantapop For triggering a function whenever it creates new data in realtime database, you should write something like this in the serverless.yml file:

myFunction:
  handler: myFunction
  events:
    - event:
        eventType: providers/cloud.firestore/eventTypes/document.update
        resource: projects/<project-id>/databases/(default)/documents/<path-to-document>

As I pointed out here, I wrote an article about it: https://medium.com/ponce-agtech/using-firebase-triggers-in-serverless-framework-ad99594b86fa

marianofino avatar Apr 04 '19 00:04 marianofino

Awesome thank you!

On Wed, Apr 3, 2019 at 5:47 PM Mariano Finochietto [email protected] wrote:

Hello @fantapop https://github.com/fantapop For triggering a function whenever it creates new data in realtime database, you should write something like this in the serverless.yml file:

myFunction: handler: myFunction events: - event: eventType: providers/cloud.firestore/eventTypes/document.update resource: projects//databases/(default)/documents/

As I pointed out here https://github.com/serverless/serverless-google-cloudfunctions/issues/146#issuecomment-479707759, I wrote an article about it: https://medium.com/ponce-agtech/using-firebase-triggers-in-serverless-framework-ad99594b86fa

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/serverless/serverless-google-cloudfunctions/issues/86#issuecomment-479708385, or mute the thread https://github.com/notifications/unsubscribe-auth/AGWbqHvOacZ40blpsEKWNwSWZ8pNteBnks5vdUuWgaJpZM4P2eKe .

fantapop avatar Apr 04 '19 01:04 fantapop