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

**URL:** <https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378>\
**Category:** General\
**Created:** [18 October 2021 20:29 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378 "2021-10-18T20:29:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sulomus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sulomus/32/49578_2.png) [@Sulomus](https://discourse.nodered.org/u/Sulomus)\
**Post date:** [18 October 2021 20:29 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/1 "2021-10-18T20:29:10Z")

</div>

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](https://www.npmjs.com/package/firebase) in flows.

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/8/88672498dcb2b6a4d9eff753244f8c406e460b80.png)

**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](https://flows.nodered.org/node/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!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 October 2021 21:00 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/2 "2021-10-18T21:00:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sulomus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sulomus/32/49578_2.png) [@Sulomus](https://discourse.nodered.org/u/Sulomus)\
**Post date:** [19 October 2021 07:59 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/3 "2021-10-19T07:59:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 October 2021 08:05 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/4 "2021-10-19T08:05:05Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![Sulomus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sulomus/32/49578_2.png) [@Sulomus](https://discourse.nodered.org/u/Sulomus)\
**Post date:** [19 October 2021 08:09 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/5 "2021-10-19T08:09:25Z")

</div>

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 🙂

Thank you very much again!

* * *

_PS.: Today I will try it and hopefully it works!_

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 October 2021 08:11 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/6 "2021-10-19T08:11:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sulomus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sulomus/32/49578_2.png) [@Sulomus](https://discourse.nodered.org/u/Sulomus)\
**Post date:** [19 October 2021 08:43 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/7 "2021-10-19T08:43:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 October 2021 08:45 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/8 "2021-10-19T08:45:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sulomus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sulomus/32/49578_2.png) [@Sulomus](https://discourse.nodered.org/u/Sulomus)\
**Post date:** [21 October 2021 11:19 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/9 "2021-10-21T11:19:09Z")

</div>

[Link to another discussion](https://discourse.nodered.org/t/adding-firebase-javascript-sdks-to-node-red-results-in-error-err-package-path-not-exported/52496) with solution on how to actually connect Firebase JavaScript SDK's to Node-red.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 November 2021 11:19 UTC](https://discourse.nodered.org/t/can-i-use-firebase-javascript-sdk-inside-node-red-flows/52378/10 "2021-11-04T11:19:37Z")

</div>

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