- root: the global module that exposes initialization, global configuration, and other cross-cutting or non‑module-specific features.
- session: the module that manages proctored session lifecycle operations such as register, start, stop, and complete.
Global Module:
init
The Proview root module is added via a loader script or imported. Proview becomes usable only after initialization usingProview.init(initOptions). The options parameter is a configuration object .
Function Type: SynchronousInit Options
Init Options
| 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. | |
| container_id | string | The ID of the HTML element where the Proview SDK will be rendered. | |
| attendee_identifier | string | Value that can identify the user in the source platform. While this is not a mandatory field at the time of init but its required to start a proctored session. | |
| workflow_identifier | string | Value that can identify the exam in the source platform. While this is not a mandatory field at the time of init but its required to start a proctored session. | |
| session_identifier | string | Value that can identify the proctored session in the source platform. | |
| limit_languages | [locale.languages][] | This will limit language options for users to select from the supported list | All supported languages |
| language | string | Explicitly set the SDK language | Browser default if its not supported then fallback to English (en-US). |
Example
Example
onError
Register a global error handler to receive notifications whenever the SDK encounters an error or warning. Proview supports only a single handler — registering a new handler replaces the previously registered one. Function Type: AsynchronousInput: A function that receives an error object as parameter describing the problem and returns void. Any error in error handler will be logged in console but not be escalated.
Error Object
Error Object
| 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 | enum | Error could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery. | |
| validationErrors | validationError[] |
Example
Example
getLanguages
Get all supported language codes. Language code in BCP‑47 format (examples: “en”, “en-US”, “fr”, “fr-CA”). The language subtag typically follows ISO 639-1 (e.g., “en”), and the optional region subtag follows ISO 3166-1 Alpha-2 (e.g., “US”). Function Type: SynchronoussetLanguage
Set the SDK’s language/locale used for localization (UI text, formatting hints, etc.). Accepts a language tag in BCP‑47 format (examples: “en”, “en-US”, “fr”, “fr-CA”). The language subtag typically follows ISO 639-1 (e.g., “en”), and the optional region subtag follows ISO 3166-1 Alpha-2 (e.g., “US”). Fallback rules- If the provided language tag is supported, the SDK applies it and returns the applied tag.
- If the provided dialect/region is not supported but the base language is, the SDK falls back to an available variant for that language (for example, “en-GB” → “en”).
- If the provided language is not supported at all, the SDK attempts to fall back to the browser default locale (if available).
- If no suitable browser default is available, the SDK falls back to English (“en”).
- The function updates the SDK’s language setting immediately and returns the effective language code.
Input: language code
Example
Example
getAttendee
Retrieve current attendee attributes. Function Type: SynchronousAttendee Attributes
Attendee Attributes
| 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 | First name of the attendee/candidate | |
| last_name | string | Last name of the attendee/candidate | |
| middle_name | string | Middle name of the attendee/candidate | |
string | Email address of the attendee/candidate | If not passed then system will generate email based on identifier. e.g: [email protected] | |
| country_code | string (3) | ISO country code | |
| 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 phone number of the attendee/candidate | |
| id | int | Talview unique id generated for the course |
Example
Example
setAttendee
Set or update the current attendee’s attributes used by the SDK (name, email, identifier, etc.). Function Type: SynchronousAttendee Attributes
Attendee Attributes
| 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 | First name of the attendee/candidate | |
| last_name | string | Last name of the attendee/candidate | |
| middle_name | string | Middle name of the attendee/candidate | |
string | Email address of the attendee/candidate | If not passed then system will generate email based on identifier. e.g: [email protected] | |
| country_code | string (3) | ISO country code | |
| 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 phone number of the attendee/candidate | |
| id | int | Talview unique id generated for the course |
Example
Example
getWorkflow
Retrieve the current workflow attributes used by the SDK.- Call this after the Proview root module has been initialized and any workflow has been configured or loaded.
- If no workflow is set, the function may return null or undefined — handle that case in your code.
Workflow
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 |
setWorkflow
Set or update the current workflow attributes used by the SDK (for example, exam or course metadata).- If a workflow identifier was provided in Proview.init and the session is already registered, the identifier supplied at initialization takes precedence and will override workflow.identifier passed to this method.
- This associate user’s action to the particular workflow.
Workflow
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 |
| proctoring_type | string | The type of the Proctored Session | One of Proview.session.types values (e.g., session.types.RECORDED). If omitted, the SDK will use the default RECORDED. |
| 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 |
Example
Example
getLocale
Returns the SDK’s current locale as an object with language, timezone, and currency. The timezone and currency fields are used only for scheduling- and payment-related features which will be supported in furture. Function Type: SynchronousLocale
Locale
| Attribute | Type | Description | Default |
|---|---|---|---|
| language | string | Language code in BCP-47 format (e.g., “en”, “en-US”, “fr”) | based on browser info |
string | ISO 4217 currency codes | based on browser info | |
string | Timezone | based on browser info |
getVersion
Return the SDK’s current version string. The SDK follows Semantic Versioning: Major,Minor,Patch. If you only need the version after initialization, call it after Proview.init. Function Type: Synchronous Output: string (Semantic Versioning, e.g. “1.2.3”).Session Module
getState
Return the current state of the proctoring session. Function Type: SynchronousSessionState
SessionState
Its of type enum which contains following values.
initregisteredrunningpausedsuspendedterminatedstoppedcompleted
register
Register attendee and workflow with the backend.You can optionally call register beforehand to optimize the workflow and improve overall process performance. Function Type: AsynchronousSessionOutput
SessionOutput
| Attribute | Type | Description | Default |
|---|---|---|---|
| uuid | GUID | Reference Talview identifier for client application to track. | |
| state | session.states | Current state of the session (init, registered, running, paused, suspended, terminated, stopped, completed) | |
| attendee | Attendee | Object containing attendee information | |
| workflow | Workflow | Object containing workflow information | If not passed then system will generate email based on identifier. e.g: [email protected] |
| identifier | string | unique session identifier from the source system. It will be the session external id in the Talview platform. |
start
Begin the proctoring session for the configured attendee and workflow. This starts whatever proctoring mode was requested (for example, recorded or live).- The Proview root module must be initialized.
- Either an attendee (or attendee identifier) and workflow (or workflow identifier) must be set or the session must already be in registered state. If required identifiers are missing, the call will fail.
- If
registeris not called beforehand, it will be executed as part of the start process.
SessionOutput
SessionOutput
| Attribute | Type | Description | Default |
|---|---|---|---|
| uuid | GUID | Reference Talview identifier for client application to track. | |
| state | session.states | Current state of the session (init, registered, running, paused, suspended, terminated, stopped, completed) | |
| attendee | Attendee | Object containing attendee information | |
| workflow | Workflow | Object containing workflow information | If not passed then system will generate email based on identifier. e.g: [email protected] |
| identifier | string | unique session identifier from the source system. It will be the session external id in the Talview platform. |
Error
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 | enum | Error could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery. | |
| validationErrors | validationError[] |
Example
Example
stop
Stop the currently active proctoring session. If no session is active, the call will fail with an error.- Attempts to stop the active session on the server and update the SDK’s session state (“stopped”).
- If no session is currently active, the call rejects or returns an error indicating that there is no session to stop.
- Perform any necessary cleanup or finalization needed (stop recording, flush artifacts, etc.) as part of stopping the session.
SessionOutput
SessionOutput
| Attribute | Type | Description | Default |
|---|---|---|---|
| uuid | GUID | Reference Talview identifier for client application to track. | |
| state | session.states | Current state of the session (init, registered, running, paused, suspended, terminated, stopped, completed) | |
| attendee | Attendee | Object containing attendee information | |
| workflow | Workflow | Object containing workflow information | If not passed then system will generate email based on identifier. e.g: [email protected] |
| identifier | string | unique session identifier from the source system. It will be the session external id in the Talview platform. |
Error
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 | enum | Error could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery. | |
| validationErrors | validationError[] |
Example
Example
complete
Mark the current proctoring session as completed. Completion is an end state — Session that are not in end state can be marked as completed, completed sessions cannot be restarted or resumed for proctoring- Transitions the session to the “completed” state on the server and updates the SDK state locally.
- Once completed, the session is final and cannot be started or resumed.
- If the session is scheduled then it will be auto completed at the session end time + buffer time
- The call should be idempotent: repeated attempts to complete an already-completed session should either succeed silently.
- Perform any finalization needed (e.g., flush pending artifacts, stop recordings) before calling complete to ensure all data is preserved and release device connection and access.
SessionOutput
SessionOutput
| Attribute | Type | Description | Default |
|---|---|---|---|
| uuid | GUID | Reference Talview identifier for client application to track. | |
| state | session.states | Current state of the session (init, registered, running, paused, suspended, terminated, stopped, completed) | |
| attendee | Attendee | Object containing attendee information | |
| workflow | Workflow | Object containing workflow information | If not passed then system will generate email based on identifier. e.g: [email protected] |
| identifier | string | unique session identifier from the source system. It will be the session external id in the Talview platform. |
Error
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 | enum | Error could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery. | |
| validationErrors | validationError[] |
Example
Example
pause
This will allow application to pause running proctored session. Function Type: Asynchronous Input: reason a string value, Void function that takes Session State, uuid (Proview session unique ID) and Error as parameter.Session State Output
Session State Output
initregisteredrunningpausedsuspendedterminatedstoppedcompleted
Example
Example
resume
This will allow application to resume a paused proctored session. Function Type: Asynchronous Input: reason a string value, Void function that takes Session State Output, uuid (Proview session unique ID) and Error as parameter.Session State Output
Session State Output
initregisteredrunningpausedsuspendedterminatedstoppedcompleted
Example
Example
Client Usage (Function):
Session Hooks
Session hooks allow you to register event listeners that get triggered when specific session state changes occur. Use the simpleProview.session.on() syntax to listen for events.
Pause
Triggered when a proctoring session is paused.Example
Example
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed
Resume
Triggered when a paused proctoring session is resumed.Example
Example
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed
Suspend
Triggered when a proctoring session is suspended due to violations or technical issues.Example
Example
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed
Terminate
Triggered when a proctoring session is terminated.Example
Example
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed
StateChange
Triggered whenever the session state changes.Example
Example
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed
Removing Event Listeners
Use theoff method to remove event listeners:
Example: Removing Listeners
Example: Removing Listeners
Session State Output
Session State Output
init- Session initializedregistered- Session registeredrunning- Session actively runningpaused- Session pausedsuspended- Session suspendedterminated- Session terminatedstopped- Session stoppedcompleted- Session completed

