<html>
  <script src="invisible.js"></script>
  <script>
    Invisible.logout();
    var john = new Invisible.models.User('john');
    john.setPassword("secret");
    john.save();
    Invisible.login("john", "secret", function(err){
    	if (!err) {
    		console.log("john is logged in!");
    	}
    });
    
    Invisible.models.Message.on('new', function(msg){
      console.log("new message arrived:", msg.text);
    })
  </script>
</html>
