> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talview.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Types

> Type definitions and interfaces for the Proview SDK, including configuration objects, session types, and data structures.

## InitOptions

| Attribute             | Type                    | Description                                                                                           | Default                                                                  |
| --------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| dsn\*                 | `string`                | The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events. |                                                                          |
| session\_identifier\* | `string`                | Value that can identify the proctored session in the source platform.                                 |                                                                          |
| allowed\_languages    | `[locale.languages]`\[] | This will limit language options for users to select from the supported list                          | All supported languages                                                  |
| language              | `[locale.languages]`    | Explicitly set the SDK language                                                                       | Browser default if its not supported then fallback to English (`en-US`). |

## Error

| Attribute        | Type                | Description                                                                                                                | Default |
| ---------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------- | ------- |
| code             | `string`            | This will identify predefined error by code. Ref Error Code section                                                        |         |
| message          | `string`            | Message will contain reason for the error.                                                                                 |         |
| Type             | `Warning/Critical`  | Error could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery. |         |
| ValidationErrors | `ValidationError[]` |                                                                                                                            |         |

## Validation Error

| Attribute | Type     | Description              | Default |
| --------- | -------- | ------------------------ | ------- |
| path      | `string` | Path of the attribute    |         |
| message   | `string` | validation error message |         |
| code      | `string` | Validation error code    |         |

## Session Type Definitions

### session.constant.type

Its of type enum which contains following values.

* `Recorded`
* `RecordedAndReview`
* `Live`
* `Dynamic`

### session.constant.state

Its of type enum which contains following values.

* `init`
* `registered`
* `running`
* `paused`
* `suspended`
* `terminated`
* `stopped`
* `completed`

## SessionOptions

| Attribute  | Type                    | Description                                                                                                   | Default |
| ---------- | ----------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
| type       | `session.constant.type` |                                                                                                               |         |
| identifier | `string`                | unique session identifier from the source system. It will be the session external id in the Talview platform. |         |

## SessionOutput

| Attribute      | Type                     | Description                                                                                                   | Default                                                                                                                           |
| -------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| uuid           | `GUID`                   | Reference Talview identifier for client application to track.                                                 |                                                                                                                                   |
| state          | `session.constant.state` |                                                                                                               |                                                                                                                                   |
| attendee       | `Attendee`               |                                                                                                               |                                                                                                                                   |
| workflow\_step | `Workflow`               |                                                                                                               | If not passed then system will generate email based on identifier. e.g: [Att0001@dnd.talview.com](mailto:Att0001@dnd.talview.com) |
| identifier     | `string`                 | unique session identifier from the source system. It will be the session external id in the Talview platform. |                                                                                                                                   |

## Attendee Type Definitions

### Attendee

| Attribute     | Type          | Description                                                                                                                 | Default                                                                                                                           |
| ------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| identifier\*  | `string`      | unique user identifier from the source system. It will be the external id in the Talview platform.                          |                                                                                                                                   |
| first\_name   | `string`      |                                                                                                                             |                                                                                                                                   |
| last\_name    | `string`      |                                                                                                                             |                                                                                                                                   |
| middle\_name  | `string`      |                                                                                                                             |                                                                                                                                   |
| email         | `string`      |                                                                                                                             | If not passed then system will generate email based on identifier. e.g: [Att0001@dnd.talview.com](mailto:Att0001@dnd.talview.com) |
| country\_code | `string (3)`  | [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements)                      |                                                                                                                                   |
| country       | `string`      | Country code is passed then system will auto identify the country otherwise system will identify country code from country. |                                                                                                                                   |
| phone         | `string (15)` | E164 format                                                                                                                 |                                                                                                                                   |
| id            | `int`         | Talview unique id generated for the course                                                                                  |                                                                                                                                   |

## Workflow Type Definitions

### Exam Workflow

| Attribute    | Type                | Description                                                                                                      | Default                                                            |
| ------------ | ------------------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| identifier\* | `string`            | Unique identifier for the exam from the calling application. It will be the external id in the Talview platform. |                                                                    |
| name         | `string`            | Name of the exam                                                                                                 | If name is not passed then external id will be used.               |
| flow\_id     | `int`               | This is the proctor session onboarding flow identifier.                                                          | if not passed then detail flow will be mapped based on project DSN |
| duration     | `int`               | duration of the exam in min                                                                                      |                                                                    |
| resource     | `[{string,string}]` | Array of key value pair to persist additional info related to exam.                                              |                                                                    |
| course       | `[Course]`          |                                                                                                                  |                                                                    |
| id           | `int`               | Talview unique id generated for the course                                                                       |                                                                    |

### Course

| Attribute  | Type                | Description                                                                                                  | Default                   |
| ---------- | ------------------- | ------------------------------------------------------------------------------------------------------------ | ------------------------- |
| id         | `int`               | Talview unique id generated for the course                                                                   |                           |
| name       | `string`            | Name of the Course the exam is part of.                                                                      | Exam workflow name        |
| identifier | `string`            | Unique identifier for the course from the calling application. If not set then exam identifier will be used. | Exam workflow external id |
| resource   | `[{string,string}]` | Array of key value pair to persist additional info related to course.                                        |                           |

### Locale

| Attribute    | Type     | Description             | Default               |
| ------------ | -------- | ----------------------- | --------------------- |
| language     | `string` |                         | based on browser info |
| ~~currency~~ | `string` | ISO 4217 currency codes | based on browser info |
| ~~timezone~~ | `string` | Timezone                | based on browser info |
