How to use Vorlon.JS in production

For your production environment, you may not want to have Vorlon activated for all clients. It's often best to have a silent Vorlon that you could activate when necessary. This sample page shows how you could activate a Vorlon session on demand.
Instead of referencing directly the client script, reference "vorlon.production.js" like this:

        <script src="http://localhost:1337/vorlon.production.js"></script>
      
This script is very small, and you can easily add it to your project's script bundles. Now you must create an instance of Vorlon production client.
        <script type="text/javascript">
          if (VORLON && VORLON.Production){
            var vorlonProd = new VORLON.Production("http://localhost:1337", "mysessionid");
          }
        </script>
      
By default, nothing will happen. You have to activate Vorlon to have all Vorlon goodness activated. By default, activation state will get persisted in session storage. It means that Vorlon activation will occur for the lifetime of the running browser. If you want state to persist, just add an extra boolean to indicate you wish to store state in localStorage. In that case, Vorlon will keep activating until you explicitely deactivate it.
        <script type="text/javascript">
          if (VORLON && VORLON.Production){
            var vorlonProd = new VORLON.Production("http://localhost:1337", "mysessionid", true);
          }
        </script>
      

Now you just have to call "vorlonProd.activate()" or "vorlonProd.deactivate()" to turn Vorlon on or off. You can call those methods with a boolean that indicate if you want to trigger a page reload.
Try it for yourself by clicking the buttons above !