Token Metadata in Tokbox
<p>I am trying to create a video chatting service that has multiple user types.   Based on these "roles" a user may simply be an observer, or an actual participant in a call.  I know via the Tokbox Api (<a href="https://tokbox.com/developer/guides/create-token/node/index.html" rel="nofollow">https://tokbox.com/developer/guides/create-token/node/index.html</a>) that you can attach metadata to tokens, but I can't for the life of me decipher how to access them on the client side. See my token creation code:</p>

<pre class="lang-js prettyprint-override"><code>app.get("/gettoken", function(req, res) {
   var sessionId = req.query.sessionid;
   var userrole = req.query.role;
   var tokenOptions = {};
   tokenOptions.role = "publisher";
   tokenOptions.data = "role="+userrole;
   var token = opentok.generateToken(sessionId, tokenOptions);
   res.send({token: token});
}) 
</code></pre>

<p>And my session subscription code that is called when a new subscriber joins the stream:</p>

<pre class="lang-js prettyprint-override"><code>session.on({
   streamCreated: function(event) {
      session.subscribe(event.stream, 'theirCamDiv', {
         insertMode: 'append'
       });
       console.log(??Subscriber Metadata??);
   }
});
</code></pre>

<p>Thanks in advance for the help!</p>