# How to get credentials value from config node on editor

**URL:** <https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356>\
**Category:** Developing Nodes\
**Created:** [18 April 2021 12:55 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356 "2021-04-18T12:55:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![diglopes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diglopes/32/8792_2.png) [@diglopes](https://discourse.nodered.org/u/diglopes)\
**Post date:** [18 April 2021 12:55 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356/1 "2021-04-18T12:55:15Z")

</div>

Hi, everyone!  
Context: I want to get some data from an API and dynamically show it on Editor  
How can I get the credentials values from the config node on Editor to make the HTTP call correctly?

`Node-RED: v1.3.1`

---

<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 April 2021 15:53 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356/2 "2021-04-18T15:53:30Z")

</div>

The documentation for creating your own nodes shows you how use credentials and config nodes.

It will be "attached" to the javascript in your .html file and can be used in something like the oneditprepare function as `this.mycredname`.

---

<div class="post-metadata">

**Author:** ![diglopes](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diglopes/32/8792_2.png) [@diglopes](https://discourse.nodered.org/u/diglopes)\
**Post date:** [18 April 2021 16:10 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356/3 "2021-04-18T16:10:49Z")

</div>

Hi, @TotallyInformation !  
When it's a default property it works exactly as you described, but it seems that when we are talking about credentials the workflow is a little bit different. Yes, we do have the reference to the credential property on `this` but can't get the value, just the node id.

---

<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 April 2021 16:25 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356/4 "2021-04-18T16:25:24Z")

</div>

The credential is going, I assume, to be defined in the config node. So you have to set it up there. It goes in a different position.

It is quite an involved set of steps. It is probably easiest to use another node's code as a reference.

---

<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:** [17 June 2021 16:26 UTC](https://discourse.nodered.org/t/how-to-get-credentials-value-from-config-node-on-editor/44356/5 "2021-06-17T16:26:19Z")

</div>

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