Publishing an event *from* Firebase

TL;DR : How to publish an event to Particle stream from inside of a Firebase function?

Hello! Below is a cool picture of my code:

My current integration and webhook work fine. The Particle cloud publishes to a Google Cloud Webhook, and the Firebase function listens for that event.

However, the myParticle.publish(stuff) within that firebase function throw a network error every time. I’ve tried adding a myParticle.login(my credentials) and that throws the same network error in FireBase console logs. Screenshot:

I’ve tried declaring the Particle stuff elsewhere, I’ve tried removing the logins, I’ve tried renaming variables, I’ve tried using different Access Tokens: none of it fixes this specific problem.

I know that one error is because I removed the promise and error-catch statements, but I assume it should still work if it works. Trying to avoid a function-variable model.

Any tips or things I should try? Thanks!

Got it…required a Firebase paid plan.

1 Like