Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

OpenTok Create Session

// Set the following constants with the API key and API secret
// that you receive when you sign up to use the OpenTok API:
var opentok = new OpenTok(API_KEY, API_SECRET);

//Generate a basic session. Or you could use an existing session ID.
var sessionId;
opentok.createSession({}, function(error, session) {
  if (error) {
    console.log("Error creating session:", error)
  } else {
    sessionId = session.sessionId;
    console.log("Session ID: " + sessionId);
  }
});

var token = opentok.generateToken(sessionId);
Source by tokbox.com #
 
PREVIOUS NEXT
Tagged: #OpenTok #Create #Session
ADD COMMENT
Topic
Name
3+8 =