What is the recommended way of disabling a template from loading in the client that depends on a boolean server variable?
I want to switch on/off certain features of a website whether if it's on staging or production, I am doing this with server variables, but I wonder what is the safest way to get this info on the client side, I wouldn't want to be possible to a client user to activate a certain functionality on the client side.
I'm using Blaze + iron router + no user accounts
Three possibilities:
Meteor.publish(null,function(){})
. Include documents and keys that will control the UI. Disable client-side updates, except possibly from your admin panel.userId
and/or session id and that contains the required keys. Sync that to the server for the current user and/or session.It's always going to be preferable to synchronize the state of the server using pubsub rather than with repeated method calls. The former will be reactive, the latter will not.