[{"data":1,"prerenderedAt":370},["ShallowReactive",2],{"blog-\u002Fblog\u002F2024\u002F06\u002Fdashboard-multi-tenancy":3},{"id":4,"title":5,"body":6,"description":12,"extension":357,"meta":358,"navigation":365,"path":366,"seo":367,"stem":368,"__hash__":369},"blog\u002Fblog\u002F2024\u002F06\u002Fdashboard-multi-tenancy.md","Multi-Tenancy available for everyone with FlowFuse's Dashboard 2.0",{"type":7,"value":8,"toc":346},"minimark",[9,13,16,19,71,76,83,90,100,125,129,138,141,155,158,163,171,174,178,186,202,224,228,231,237,247,259,265,270,273,282,291,299,308,312,325,334,338],[10,11,12],"p",{},"FlowFuse Dashboard has featured multi-tenancy features through the FlowFuse User Addon. This made user based applications available only to specific FlowFuse team tiers and customers. However, the Node-RED community wanted to use the same feature set in cases FlowFuse didn't consider initially. Taking this feedback on board, today we announce some significant changes to how you can build Dashboards with multi-tenancy in mind.",[10,14,15],{},"Having taken that feedback on board, we've made some significant changes to how you can build Dashboards with multi-tenancy in mind.",[10,17,18],{},"A quick summary of the changes are as follows:",[20,21,22,43,53],"ul",{},[23,24,25,29,30,34,35,39,40,42],"li",{},[26,27,28],"strong",{},"Socket constraints moved to core Dashboard:"," The ability to constrain communications to a specific client (using the ",[31,32,33],"code",{},"msg._client.socketId",") has been moved to the core of Dashboard 2.0, and is no longer a feature of the FlowFuse User Addon. As such, it's available to ",[36,37,38],"em",{},"all"," users, for ",[36,41,38],{}," node types.",[23,44,45,48,49,52],{},[26,46,47],{},"FlowFuse User Addon now Source Available:"," The addon is available to install in ",[36,50,51],{},"any"," instances of Node-RED running on FlowFuse, so that's all team tiers on FlowFuse Cloud, and any self-hosted instances of FlowFuse too. It is available to install from Node-RED's Palette Manager.",[23,54,55,58,59,62,63,70],{},[26,56,57],{},"Cloudflare Auth Plugin:"," Release of the first community-created Auth Plugin for Dashboard for adding a ",[31,60,61],{},"user"," object when authenticating with Cloudflare. (See more details and install the plugin ",[64,65,69],"a",{"href":66,"rel":67},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002F@fullmetal-fred\u002Fnode-red-dashboard-2-cloudflare-auth",[68],"nofollow","here",")",[72,73,75],"h2",{"id":74},"using-client-data","Using Client Data",[10,77,78,79,82],{},"Available since our ",[31,80,81],{},"1.10.0"," release of Dashboard, we have a new sidebar tab - \"Client Data\".",[10,84,85,86,89],{},"This new tab acts as a portal to control whether data about the connected clients is included in any events emitted in the Node-RED editor (appended into ",[31,87,88],{},"msg._client","). You can then use the \"Accept CLient Data\" options to define which nodes accept that data as a constraint for communication.",[10,91,92,98],{},[93,94],"img",{"alt":95,"dataZoomable":96,"src":97},"Screenshot showing the new \"Client Data\" sidebar available with Dashboard","","\u002Fblog\u002F2024\u002F06\u002Fimages\u002Fdashboard-multi-tenancy-sidebar.png",[36,99,95],{},[10,101,102,103,106,107,110,111,114,115,117,118,120,121,124],{},"In this case, if we send a ",[31,104,105],{},"msg"," to any ",[31,108,109],{},"ui-notification"," or ",[31,112,113],{},"ui-control"," which a specified ",[31,116,33],{},", then that ",[31,119,105],{}," will ",[36,122,123],{},"only"," be sent to the relevant socket connection.",[72,126,128],{"id":127},"building-multi-tenant-dashboards","Building Multi-Tenant Dashboards",[10,130,131,132,137],{},"We have introduced a new section to our documentation on ",[64,133,136],{"href":134,"rel":135},"https:\u002F\u002Fdashboard.flowfuse.com\u002Fgetting-started.html#design-patterns",[68],"Design Patterns",".",[10,139,140],{},"To summarise briefly, we now consider there to be two primary design patterns when building with Dashboard:",[20,142,143,149],{},[23,144,145,148],{},[26,146,147],{},"Single Source of Truth",": All users of your Dashboard will see the same data. This is useful for industrial IoT or Home Automation applications.",[23,150,151,154],{},[26,152,153],{},"Multi-Tenancy",": Data shown in a particular widget is unique to a given client\u002Fsession\u002Fuser. This represents a more traditional web application, where each user has their own session and associated data.",[10,156,157],{},"Note that these patterns can be intertwined, some widgets on a screen may be driven by \"Single Source of Truth\", and others by \"Multi-Tenancy\".",[159,160,162],"h4",{"id":161},"building-a-single-source-of-truth-dashboard","Building a Single Source of Truth Dashboard",[10,164,165,169],{},[93,166],{"alt":167,"dataZoomable":96,"src":168},"Example flow diagram to show the flow of data in a \"Single Source of Truth\" architecture","\u002Fblog\u002F2024\u002F06\u002Fimages\u002Fdesign-pattern-single.png",[36,170,167],{},[10,172,173],{},"Data can be sent to these widgets at any time, when a user connects to the Dashboard, the respective widget will load the relevant data from the centralised data source in Node-RED and show it to the user.",[159,175,177],{"id":176},"building-a-multi-tenancy-dashboard","Building a Multi-Tenancy Dashboard",[10,179,180,184],{},[93,181],{"alt":182,"dataZoomable":96,"src":183},"Example flow diagram to show the flow of data in a \"Multi-Tenancy\" architecture","\u002Fblog\u002F2024\u002F06\u002Fimages\u002Fdesign-pattern-client.png",[36,185,182],{},[10,187,188,189,192,193,195,196,198,199,201],{},"In this pattern, a very useful node is the ",[31,190,191],{},"ui-event"," node which fires a ",[31,194,105],{}," when a user views a page. This ",[31,197,105],{}," will contain a ",[31,200,88],{}," object, detailing the client's connection.",[10,203,204,205,208,209,212,213,217,218,220,221,223],{},"This ",[31,206,207],{},"_client"," object contains the ",[31,210,211],{},"socketId"," of the user (and potentially more depending on any ",[64,214,216],{"href":215},"#authentication-plugins","Authentication plugins"," used). This ",[31,219,105],{}," can then be passed through to any other widget, and if configured to \"Accept Client Constraints\" that ",[31,222,105],{}," will only be sent to the specified client.",[72,225,227],{"id":226},"authentication-plugins","Authentication Plugins",[10,229,230],{},"In this release we've also added a special category of plugins, \"Authentication Plugins\".",[10,232,233,234,236],{},"These plugins register themselves with Dashboard, and are permitted to add to the ",[31,235,88],{}," object. This can be useful for adding additional information about end users, such as their user ID, e-mail address or username.",[10,238,239,240,242,243,246],{},"This data can be used to constrain communications from Node-RED to a specific ",[36,241,61],{}," rather than just a ",[36,244,245],{},"socket connection",", which is far more reliable and secure.",[10,248,249,253],{},[93,250],{"alt":251,"dataZoomable":96,"src":252},"Screenshot showing \"FlowFuse User\" being appended to _client by the FlowFuse User Addon","\u002Fblog\u002F2024\u002F06\u002Fimages\u002Fdashboard-include-client-data.png",[36,254,255,256,258],{},"Screenshot showing \"FlowFuse User\" being appended to ",[31,257,207],{}," by the FlowFuse User Addon",[10,260,261,262,264],{},"Any active plugins you have installed, will also be detailed in the new \"Client Data\" sidebar (detailed above) so you can see which plugins are active and what data they are adding to the ",[31,263,88],{}," object.",[266,267,269],"h3",{"id":268},"flowfuse-user-addon","FlowFuse User Addon",[10,271,272],{},"Whilst the plugin was first published a few months back, after hearing community feedback, we've made changes and are now publishing the plugin to the Node_RED Palette Manager. As such, it's available to all users running FlowFuse.",[10,274,275,276,278,279,281],{},"The addon appends a ",[31,277,61],{}," object to the ",[31,280,88],{}," object, populated with the details of the FlowFuse user performing the relevant actions in Dashboard. You can use this information to build multi-tenant Dashboards.",[10,283,284,285,290],{},"You can ",[64,286,289],{"href":287,"rel":288},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002F@flowfuse\u002Fnode-red-dashboard-2-user-addon",[68],"install the FlowFuse User Addon"," from the Palette Manager in the Node-RED editor.",[10,292,293,297],{},[93,294],{"alt":295,"dataZoomable":96,"src":296},"Screenshot of the Instance settings in FlowFuse to enable \"FlowFuse User Authentication\"","\u002Fblog\u002F2024\u002F06\u002Fimages\u002Fflowfuse-instance-security.png",[36,298,295],{},[10,300,301,302,307],{},"It's worth noting that instances must have ",[64,303,306],{"href":304,"rel":305},"https:\u002F\u002Fflowfuse.com\u002Fblog\u002F2024\u002F04\u002Fdisplaying-logged-in-users-on-dashboard\u002F#enabling-flowfuse-user-authentication",[68],"\"FlowFuse User Authentication\""," switched on in the instance's settings.",[266,309,311],{"id":310},"cloudfare-user-addon-community-contribution","Cloudfare User Addon (Community Contribution)",[10,313,314,315,319,320,278,322,324],{},"We're also thrilled to announce that the first community-contributed plugin has been ",[64,316,318],{"href":66,"rel":317},[68],"published"," which will append a ",[31,321,61],{},[31,323,88],{}," object when authenticating with Cloudflare.",[10,326,327,328,333],{},"A huge thanks to Fred Loucks (",[64,329,332],{"href":330,"rel":331},"https:\u002F\u002Fgithub.com\u002Ffullmetal-fred",[68],"@fullmetal-fred"," on GitHub) for his great contribution!",[72,335,337],{"id":336},"build-multi-tenant-dashboards-with-flowfuse-cloud","Build Multi Tenant Dashboards with FlowFuse Cloud",[10,339,340,341,137],{},"Start by following our ",[64,342,345],{"href":343,"rel":344},"https:\u002F\u002Fdashboard.flowfuse.com\u002Fuser\u002Fmulti-tenancy.html#building-multi-tenant-dashboards",[68],"Getting Started Guide",{"title":96,"searchDepth":347,"depth":347,"links":348},2,[349,350,351,356],{"id":74,"depth":347,"text":75},{"id":127,"depth":347,"text":128},{"id":226,"depth":347,"text":227,"children":352},[353,355],{"id":268,"depth":354,"text":269},3,{"id":310,"depth":354,"text":311},{"id":336,"depth":347,"text":337},"md",{"navTitle":5,"excerpt":359},{"type":7,"value":360},[361,363],[10,362,12],{},[10,364,15],{},true,"\u002Fblog\u002F2024\u002F06\u002Fdashboard-multi-tenancy",{"title":5,"description":12},"blog\u002F2024\u002F06\u002Fdashboard-multi-tenancy","kYO0UqqAGbbdeCOssHq7vLTKTTVGJ9ycXPQDBZ403hE",1780070551903]