# WTSession.connect(sToken, pName, uC, m)

`connect(streamingToken, participantName, userConstraints, metadata)`

This method will allow you to connect to the session

* *streamingToken* (*required*) - JWT token which you can get from CAS. Note: For connecting two or users in the same session you need to share tokens between participants.
* *participantName (required)* - participant name in the session
* userConstraints (*optional*) - object with two fields {audio: boolean, video: boolean, videoCodecs\*: Object }

```
//* Defaults for videoCodecs constraints:
videoCodecs: {
   priorityList: ['H264', 'VP8'],
   forcingCodec: false,
   applyToAnswer: false,
   skipPrioritization: false,
}
```

1. priorityList (Array) - ordered video codecs list by priority (keep in mind that browsers are still select the best approach based on internal algorithms)
2. forcingCodec (String || boolean) - a specific codec which will be used to prepare  a SDP offer (marks that device able use for output streaming video the only selected codec)
3. applyToAnswer (boolean) - If true codec from forcingCodec property will be applied not only to outgoing video, but onto incoming as well. Keep in mind if some of device doesn’t support selected codec it would not be able to connect
4. skipPrioritization (boolean) - if true then browser sort and apply codecs according to internal SDP specification

* *metadata (optional)* - object allow to share some info between participants


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/sscale-confluence-web-sdk-reference/wt-session/wtsession.connect-stoken-pname-uc-m.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
