# Custom node: comms between html and js files

**URL:** <https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319>\
**Category:** Developing Nodes\
**Created:** [21 August 2024 21:58 UTC](https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319 "2024-08-21T21:58:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpadie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jpadie/32/87036_2.png) [@jpadie](https://discourse.nodered.org/u/jpadie)\
**Post date:** [21 August 2024 21:58 UTC](https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319/1 "2024-08-21T21:58:33Z")

</div>

is the config object shared bi-directionally between the runtime js and the associated html file? for example a runtime script needs to instantiate an object and fire up a server and return a qr code to the editor. can the qr code be "saved" to the config object passed to the js file's createnode method such that the added properties are accessible to the html file's edit dialog?

I've seen other custom nodes fetch data via ajax but I have not been able to find the documentation that describes this method.

---

<div class="post-metadata">

**Author:** ![jpadie](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jpadie/32/87036_2.png) [@jpadie](https://discourse.nodered.org/u/jpadie)\
**Post date:** [22 August 2024 09:03 UTC](https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319/2 "2024-08-22T09:03:39Z")

</div>

I have found an old article saying it can (only) be done via http routing. Which I take it means that the config is static to the runtime.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [22 August 2024 10:32 UTC](https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319/3 "2024-08-22T10:32:54Z")

</div>

Yes, see

> [@Updating node config on deploy](https://discourse.nodered.org/t/updating-node-config-on-deploy/90087/4):
>
> A common method is to do it in two steps: user adds the node, configures static configs and deploys. user reopens the node to configure all the new dynamically added configs. What matters here is the redeployment because without it you can't save new configs to NR. If this method doesn't suit you, the only other solution is to use the Storage API to save your stuff but since it's not very used there aren't many examples.

---

<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:** [21 October 2024 10:33 UTC](https://discourse.nodered.org/t/custom-node-comms-between-html-and-js-files/90319/4 "2024-10-21T10:33:04Z")

</div>

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