Can I use Firebase Javascript SDK inside Node-red flows?

Hi,
I am completely new in Node-red and would be grateful for some guidance.

  • As I understand Node-red runs on NODE.js.

  • I want to use Firebase Javascript SDK's in flows.

  • In their docs it is specified that I can use these SDK's in a IoT device:

My question is: is it really possible? If so how?

Should I just call the SDK functions using function node and assign objects to global context?


Why I don't wanna use Node-red packages like node-red-contrib-firebase or node-red-contrib-firebase-data:

  • They are not updated frequently

  • I would be more then happy to use officials SDK's and write my own code (and in the future maybe develop Node-red wrapper for those SDK's)

Thanks in advance for all input!

The short answer is that it probably is possible - using the function node as you say.

1 Like

Thank you for answer! I am planning to use it inside a real production - so I need to know all downsides and risks using this SW.

Could you say please why it is probably possible? Is there anything on top of your head that could cause serious problems?

Thank you in advance.

Probably, because I've not tried it, I don't use Firebase. Most Node.js modules will work in Node-RED.

The only real downside of doing things in the function node is that it wraps your code in a Node.js virtual machine and so has some overheads.

If one of the existing nodes meets your needs other than not being up-to-date, why not offer the author to take it over or at least become a co-maintainer? If you don't get any responses from them, you could always fork it and create something new - as long as you are prepared to maintain it of course :slight_smile:

1 Like

By overheads you mean that it will only have effect on it's speed or anything else? If it's just speed I am completely fine with that.

  • I am considering offering help to the maintainer. But for now I am too busy to get into it.

  • I am starting a start-up so in the future I will definitely need to have some kind of library where I will have all my functions (in this case nodes).

I am just too new in this to offer some real help :slight_smile:

Thank you very much again!


PS.: Today I will try it and hopefully it works!

There is a theoretical memory overhead I suppose. But honestly, amongst the other potential inefficiencies of Node.js and Node-RED and the efficiencies delivered by the V8 JavaScript engine, very unlikely that you will see any noticable difference.

1 Like

Could you please provide a link or some advice on how to use third party libraries inside Node-red?

Assuming that you are using a recent version of Node-RED, this is covered in the docs.

1 Like

Link to another discussion with solution on how to actually connect Firebase JavaScript SDK's to Node-red.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.