Skip to content

Commit bb78e33

Browse files
committed
Add docs for custom NPM nodes
1 parent 1614c07 commit bb78e33

File tree

7 files changed

+115
-0
lines changed

7 files changed

+115
-0
lines changed

docs/user/custom-npm-packages.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
navTitle: Custom Node Packages
3+
---
4+
5+
# Custom Node Packages
6+
7+
FlowFuse has access to the wide range of Node-RED nodes listed in the public
8+
catalogue as found on https://flows.nodered.org. But occasionally there will
9+
be the need for a custom node for a situation that is specific to your Team.
10+
11+
If you decide to [develop](https://nodered.org/docs/creating-nodes/) your
12+
own node, you will need somewhere to host both the node and a Node-RED
13+
catalogue file. FlowFuse has 2 solutions for this.
14+
15+
## FlowFuse Hosted Nodes
16+
17+
If you want to create a Node-RED node for private use by Instances in your
18+
FlowFuse Team then you can publish them to the FlowFuse Custom Node Registry
19+
(available to Teams and Enterprise level teams on FlowFuse Cloud).
20+
21+
### Publishing Nodes
22+
23+
After developing your node you can publish it to your Teams Custom Nodes
24+
registry with the following steps
25+
26+
#### Authenticating
27+
28+
Before publishing to the registry you need to authenticate. This step should
29+
only need to be done once.
30+
31+
The credentials can be found by navigating to the "Custom Nodes" tab under
32+
the Team Library and clicking on the "Publish" button.
33+
34+
![Publish Custom Package](./images/publish-custom-package.png){data-zoomable}
35+
_Publish Custom Package_
36+
37+
```
38+
npm login --registry=https://registry.flowfuse.dev
39+
```
40+
41+
#### Packaging
42+
43+
There are steps required to ensure your node is correctly packaged for the
44+
FlowFuse Custom Nodes registry
45+
46+
1. Make sure the package name contains the correct scope prefix e.g.
47+
`@flowfuse-[team id]/node-name`. The correct prefix will be shown on the in
48+
the FlowFuse application
49+
2. Add a `publishConfig` section with a `registry` entry
50+
51+
52+
e.g. for a Team with ID `6Rag1kQj4k`
53+
```json
54+
{
55+
"name": "@flowfuse-6Rag1kQj4k/bar",
56+
"version": "0.0.1",
57+
"description": "...",
58+
"publishConfig": {
59+
"registry": "https://registry.flowfuse.dev"
60+
},
61+
...
62+
}
63+
```
64+
65+
#### Publishing
66+
67+
In the same directory as the `package.json` file run the following command
68+
69+
```
70+
npm publish
71+
```
72+
73+
Once published you should see the Node listed in the "Custom Nodes" section
74+
of the Team Library.
75+
76+
![Custom Node List](./images/custom-node-library.png){data-zoomable}
77+
_Custom Node List_
78+
79+
### Installing Nodes
80+
81+
Any packages uploaded to the Team Library will be published to your Instances
82+
under a custom catalogue with the name "FlowFuse Team [team name] Catalogue"
83+
84+
![Node-RED Custom Catalogue](./images/custom-catalogue.png){data-zoomable}
85+
_Custom Catalogue_
86+
87+
88+
## 3rd Party NPM Registries or Private npmjs.org packages
89+
90+
The following features are available to Team and Enterprise users of FlowFuse
91+
Cloud.
92+
93+
### NPM Registries
94+
95+
If you have already published packages to an existing NPM Registry then you
96+
can enable access to this by adding the required values to a `.npmrc" file
97+
in the Instance Settings.
98+
99+
This can include authentication tokens to access private packages.
100+
101+
![.npmrc file](./images/instance-settings-npmrc.png){data-zoomable}
102+
_.npmrc file_
103+
104+
### Node-RED Catalogues
105+
106+
In order to be able to install packages in the Node-RED editor they need to
107+
in a Node-RED Catalogue file that is loaded from a HTTPS URL. You can
108+
supply a list of Catalogue URLS in the Instance Settings.
109+
110+
![Node Catalogues](./images/instance-settings-catalogues.png){data-zoomable}
111+
_Node Catalogues_
87.6 KB
Loading
88.1 KB
Loading
30.8 KB
Loading
12.1 KB
Loading
190 KB
Loading

docs/user/introduction.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ FlowFuse supports reading and writing persistent files and persistent context.
8383
## Working with MQTT
8484

8585
- [Team Broker](/docs/user/teambroker.md) - Working with the FlowFuse bundled MQTT Broker
86+
87+
## Working with Custom Nodes
88+
89+
- [Custom Nodes](/docs/user/custom-npm-packages.md) - Publishing Custom Node-RED Nodes

0 commit comments

Comments
 (0)