> For the complete documentation index, see [llms.txt](https://documentation.sceenic.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/ios-swift-reference-new/session.md).

# Session

## SessionBuilder <a href="#session-swifty-sessionbuilder" id="session-swifty-sessionbuilder"></a>

| Return type    | Method                                                          | Description                                  | Params                                                                              |
| -------------- | --------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------- |
|                | init()                                                          | The default initializer                      |                                                                                     |
| SessionBuilder | withUsername(\_ username: String) -> SessionBuilder             | Specify the username                         | <ul><li><strong>username</strong> - a display name</li></ul>                        |
| SessionBuilder | withDelegate(\_ delegate: SessionDelegate) -> SessionBuilder    | Subscribe a delegate for receiving callbacks | <ul><li><strong>delegate</strong> - an instance for reporting callbacks</li></ul>   |
| SessionBuilder | withCallbackQueue(\_ queue: DispatchQueue) -> SessionBuilder    | Register a queue for receiving callbacks     | <ul><li><strong>queue</strong> - a dispatch queue for reporting callbacks</li></ul> |
| SessionBuilder | withVideoCodec(\_ codec: VideoCodec) -> SessionBuilder          | Specify a video codec type                   | <ul><li><strong>codec</strong> - a video codec type</li></ul>                       |
| SessionBuilder | withVideoRenderer(\_ renderer: VideoRenderer) -> SessionBuilder | Specify a video renderer type                | <ul><li><strong>renderer</strong> - a video renderer type</li></ul>                 |
| Session        | build() -> Session                                              | Construct a session instance                 |                                                                                     |

## Field Summary <a href="#session-swifty-fieldsummary" id="session-swifty-fieldsummary"></a>

| LocalParticipant | localParticipant | Represents a local user                                                       |
| ---------------- | ---------------- | ----------------------------------------------------------------------------- |
| SessionDelegate? | delegate         | An optional delegate for receiving callbacks                                  |
| DispatchQueue    | callbackQueue    | A dispatch queue for receiving callbacks. The default queue is the main queue |
| SessionState     | sessionState     | Enum with current session state                                               |

## Method Summary <a href="#session-swifty-methodsummary" id="session-swifty-methodsummary"></a>

<br>

| Return type      | Methods                                                  | Description                                  | Parameters                                                                                                                                                      |
| ---------------- | -------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| void             | connect(with token: String)                              | Connect a session                            | <ul><li><strong>token</strong> - authentication token </li></ul>                                                                                                |
| void             | disconnect()                                             | Leave a room and teardown WebRTC session     | <p><br></p>                                                                                                                                                     |
| UIViewController | createLogsViewController()                               | Return view controller with all Session logs | <p><br></p>                                                                                                                                                     |
| void             | sendMessage(message: String)                             | sends message to all conference participants | <ul><li><strong>message</strong> - text to send</li></ul>                                                                                                       |
| void             | forceDisconnect(participantId: String, message: String?) | kick partitipant by id from session          | <p></p><ul><li><strong>participantId</strong> -selected participant id</li><li> <strong>message -</strong> optional supplemental message(kick reason)</li></ul> |

## Static Method Summary <a href="#session-swifty-staticmethodsummary" id="session-swifty-staticmethodsummary"></a>

| Return type | Methods                                 | Description         | Parameters                                                              |
| ----------- | --------------------------------------- | ------------------- | ----------------------------------------------------------------------- |
| void        | setMinLogLevel(\_ logLevel: WTLogLevel) | Specify a log level | <ul><li><strong>logLevel</strong> - a level for logs produced</li></ul> |
