0

im trying to run a scheduled function in firebase emulator but cannot find the pubsub option when I run firebase init. Refer pic below enter image description here

The options I get are Realtime Database, Firestore, Functions, Hosting, Storage, Emulators and Remote Config, there is no pubsub.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Nvv
  • 79
  • 10
  • 1
    You may refer to the [documentation](https://firebase.google.com/docs/functions/local-emulator#instrument_your_app_to_talk_to_the_emulators). – Mousumi Roy Jan 28 '22 at 06:54

1 Answers1

2

"pubsub" functions are created using cloud functions. It is part of Cloud Functions. You only have to initialize(init) Functions. Write the pubsub triggers there. View documentation for extra details on how to code pubsub - DOCS https://firebase.google.com/docs/functions/pubsub-events

Haris Wilson
  • 146
  • 4
  • I followed this: https://stackoverflow.com/questions/61253788/how-to-use-firebase-emulators-pubsub-to-test-timed-functions-locally . I followed the top comment, it says to select pubsub after running firebase init, I can't find pubsub after running firebase init – Nvv Jan 27 '22 at 12:34
  • You do not need to select pubsub separately. Select Cloud Functions and start writing your "pubsub" code in "index.js" file in "functions" folder. – Haris Wilson Feb 10 '22 at 05:43