Skip to main content
The Proview SDK composed of the following modules:
  • 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 using Proview.init(initOptions). The options parameter is a configuration object . Function Type: Synchronous
Only when the Proview root module is initialized, other features and modules are accessible.
function init(initOptions: InitOptions): void;
AttributeTypeDescriptionDefault
dsn*stringThe DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events.
container_idstringThe ID of the HTML element where the Proview SDK will be rendered.
attendee_identifierstringValue 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_identifierstringValue 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_identifierstringValue 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 listAll supported languages
languagestringExplicitly set the SDK languageBrowser default if its not supported then fallback to English (en-US).
<script>
    // Configure proviewOnLoad before adding the Loader Script
    window.proviewOnLoad = function () {
    Proview.init({ dsn: "" });
};
</script>

<script src="https://dev.proview.io/cdn/init.js" async crossorigin="anonymous"></script>

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: Asynchronous
Input: 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.
function onError(errorHandler: ErrorObject): void;
AttributeTypeDescriptionDefault
codestringThis will identify predefined error by code. Ref Error Code section
messagestringMessage will contain reason for the error.
typeenumError could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery.
validationErrorsvalidationError[]
<script>
  // Configure proviewOnLoad before adding the Loader Script
  window.proviewOnLoad = function () {
    Proview.init({
      dsn: "",
		  type: Proview.ProctoringType.RECORDED,
		  attendee_identifier :"att_0001",
		  workflow_identifier :"exam_0023"
    });

    // Register an error handler
    Proview.onError((err)=>{
		  // handle or log the error
      console.error('Proview error:', err);
      // e.g., send to your telemetry system
      // sendTelemetry('proview_error', err);
    });
  };
</script>

<script
  src="https://dev.proview.io/cdn/init.js" async
  crossorigin="anonymous">
</script>

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: Synchronous
function getLanguages(): string[];

setLanguage

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.
Function Type: Synchronous
Input: language code
function setLanguage(language: string): string;
// Set French (generic)
const applied = Proview.locale.setLanguage('fr');
console.log('Language set to:', applied); // e.g. "fr"

// Set English (United States)
Proview.locale.setLanguage('en-US');

// If unsupported, SDK falls back (browser default or 'en')
const applied2 = Proview.locale.setLanguage('xx-YY');
console.log(applied2); // e.g. "en" or browser default

getAttendee

Retrieve current attendee attributes. Function Type: Synchronous
function getAttendee(): Attendee | undefined ;
AttributeTypeDescriptionDefault
identifier*stringunique user identifier from the source system. It will be the external id in the Talview platform.
first_namestringFirst name of the attendee/candidate
last_namestringLast name of the attendee/candidate
middle_namestringMiddle name of the attendee/candidate
emailstringEmail address of the attendee/candidateIf not passed then system will generate email based on identifier. e.g: [email protected]
country_codestring (3)ISO country code
countrystringCountry code is passed then system will auto identify the country otherwise system will identify country code from country.
phonestring (15)E164 format phone number of the attendee/candidate
idintTalview unique id generated for the course
// Get the current attendee information
const attendee = Proview.getAttendee();

if (attendee) {
    console.log('Attendee identifier:', attendee.identifier);
    console.log('Full name:', `${attendee.first_name} ${attendee.last_name}`);
    console.log('Email:', attendee.email);
    console.log('Country:', attendee.country);
    console.log('Phone:', attendee.phone);
} else {
    console.log('No attendee information available');
}

setAttendee

Set or update the current attendee’s attributes used by the SDK (name, email, identifier, etc.).
Unique Identifier
  • Identifier is a unique field to map the user with the session.
  • Change of identifier via SDK is not support post the session register / start
  • It can be set either via setAttendee or as part of init via initOptions
Function Type: Synchronous
function setAttendee(Attendee): void ;
AttributeTypeDescriptionDefault
identifier*stringunique user identifier from the source system. It will be the external id in the Talview platform.
first_namestringFirst name of the attendee/candidate
last_namestringLast name of the attendee/candidate
middle_namestringMiddle name of the attendee/candidate
emailstringEmail address of the attendee/candidateIf not passed then system will generate email based on identifier. e.g: [email protected]
country_codestring (3)ISO country code
countrystringCountry code is passed then system will auto identify the country otherwise system will identify country code from country.
phonestring (15)E164 format phone number of the attendee/candidate
idintTalview unique id generated for the course

const attendee = {
    first_name: "James",
    last_name: "Handerson",
    email: "[email protected]",
    identifier: "Att0001",
};

try {
    Proview.setAttendee(attendee);
} catch (error) {
    console.error('Failed to set attendee:', error);
    // handle the error from the application
}

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.
Function Type: Synchronous
function getWorkflow(): Workflow | undefined;
AttributeTypeDescriptionDefault
identifier*stringUnique identifier for the exam from the calling application. It will be the external id in the Talview platform.
namestringName of the examIf name is not passed then external id will be used.
flow_idintThis is the proctor session onboarding flow identifier.if not passed then detail flow will be mapped based on project DSN
durationintduration of the exam in min
resource[{string,string}]Array of key value pair to persist additional info related to exam.
course[Course]
idintTalview 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.
If workflow associated information is utilized by the system then system will throw an error.
Function Type: Synchronous
function setWorkflow(Workflow): void;
AttributeTypeDescriptionDefault
identifier*stringUnique identifier for the exam from the calling application. It will be the external id in the Talview platform.
namestringName of the examIf name is not passed then external id will be used.
flow_idintThis is the proctor session onboarding flow identifier.if not passed then detail flow will be mapped based on project DSN
proctoring_typestringThe type of the Proctored SessionOne of Proview.session.types values (e.g., session.types.RECORDED). If omitted, the SDK will use the default RECORDED.
durationintduration of the exam in min
resource[{string,string}]Array of key value pair to persist additional info related to exam.
course[Course]
idintTalview unique id generated for the course
Proview.setWorkflow({
    name: "Applied Science - Paper 1",
    identifier: "2930034",
    course: {
    name: "B.Sc in Applied Sciences",
    identifier: "2025-B-ASCI-001"
}
});

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: Synchronous
function getLocale(): Locale
AttributeTypeDescriptionDefault
languagestringLanguage code in BCP-47 format (e.g., “en”, “en-US”, “fr”)based on browser info
currencystringISO 4217 currency codesbased on browser info
timezonestringTimezonebased 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”).
function getVersion(): String ;

Session Module

getState

Return the current state of the proctoring session. Function Type: Synchronous
function getState(): SessionState ;
Its of type enum which contains following values.
  • init
  • registered
  • running
  • paused
  • suspended
  • terminated
  • stopped
  • completed

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: Asynchronous
function register(callback: (sessionOutput: SessionOutput | null, err: Error | null) => void): void;
AttributeTypeDescriptionDefault
uuidGUIDReference Talview identifier for client application to track.
statesession.statesCurrent state of the session (init, registered, running, paused, suspended, terminated, stopped, completed)
attendeeAttendeeObject containing attendee information
workflowWorkflowObject containing workflow informationIf not passed then system will generate email based on identifier. e.g: [email protected]
identifierstringunique 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 register is not called beforehand, it will be executed as part of the start process.
Function Type: Asynchronous
function start(): Promise<SessionOutput>;
                            //or
function start(callback: (sessionOutput: SessionOutput, error: Error) => void): void;
AttributeTypeDescriptionDefault
uuidGUIDReference Talview identifier for client application to track.
statesession.statesCurrent state of the session (init, registered, running, paused, suspended, terminated, stopped, completed)
attendeeAttendeeObject containing attendee information
workflowWorkflowObject containing workflow informationIf not passed then system will generate email based on identifier. e.g: [email protected]
identifierstringunique session identifier from the source system. It will be the session external id in the Talview platform.
AttributeTypeDescriptionDefault
codestringThis will identify predefined error by code. Ref Error Code section
messagestringMessage will contain reason for the error.
typeenumError could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery.
validationErrorsvalidationError[]
Proview.session.start((sessionOutput, err)=>{
if (err) {
    console.error('Failed to start session:', err);
    return;
}
    console.log('Session state:', sessionOutput.state);
    console.log('Session uuid:', sessionOutput.uuid);
});

// or
try
{
    const sessionOutput = await Proview.session.start();
} catch (err) {
console.error('Failed to start session:', err);
}

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.
Function Type: Asynchronous
function stop(): Promise<SessionOutput>;
            //or
function stop(callback: (sessionOutput: SessionOutput | null, err: Error | null) => void): void;
AttributeTypeDescriptionDefault
uuidGUIDReference Talview identifier for client application to track.
statesession.statesCurrent state of the session (init, registered, running, paused, suspended, terminated, stopped, completed)
attendeeAttendeeObject containing attendee information
workflowWorkflowObject containing workflow informationIf not passed then system will generate email based on identifier. e.g: [email protected]
identifierstringunique session identifier from the source system. It will be the session external id in the Talview platform.
AttributeTypeDescriptionDefault
codestringThis will identify predefined error by code. Ref Error Code section
messagestringMessage will contain reason for the error.
typeenumError could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery.
validationErrorsvalidationError[]
Proview.session.stop((sessionOutput, err) => {
if (err) {
    console.error('Failed to stop session:', err);
    return;
}
    console.log('Session state:', sessionOutput.state);
});

// or

try {
    const sessionOutput = await Proview.session.stop();
    console.log('Session state:', sessionOutput.state);
} catch (err) {
console.error('Failed to stop session:', err);
}

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.
Function Type: Asynchronous
function complete(callback:(sessionOutput: SessionOutput | null, err: Error | null) => void): void;
AttributeTypeDescriptionDefault
uuidGUIDReference Talview identifier for client application to track.
statesession.statesCurrent state of the session (init, registered, running, paused, suspended, terminated, stopped, completed)
attendeeAttendeeObject containing attendee information
workflowWorkflowObject containing workflow informationIf not passed then system will generate email based on identifier. e.g: [email protected]
identifierstringunique session identifier from the source system. It will be the session external id in the Talview platform.
AttributeTypeDescriptionDefault
codestringThis will identify predefined error by code. Ref Error Code section
messagestringMessage will contain reason for the error.
typeenumError could be of type warning or critical. When critical error is raised it will impact core proctoring feature delivery.
validationErrorsvalidationError[]
Proview.session.complete((sessionOutput, err) => {
  if (err) {
    console.error('Failed to complete session:', err);
    return;
  }
  console.log('Session state:', sessionOutput.state);
});

// or

try {
  const sessionOutput = await Proview.session.complete({
    score: 87,
    finishedAt: new Date().toISOString()
  });
  console.log('Session state:', sessionOutput.state); // "completed"
} catch (err) {
  console.error('Failed to complete session:', err);
}

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.
function pause(reason: string, callback: (output: sessionStateOutput, err: Error | null) => void): void;
SessionStateOutput = {
state: Session State
reason: string
}

Session State is of type enum which contains following values.
  • init
  • registered
  • running
  • paused
  • suspended
  • terminated
  • stopped
  • completed
// Pause the current proctoring session
Proview.session.pause("User requested break", (sessionStateOutput, err) => {
if (err) {
console.error('Failed to pause session:', err);
return;
}
console.log('Session paused:', sessionStateOutput.state); // "paused"
});

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.
function resume(reason: string, callback: (output: sessionStateOutput, err: Error | null) => void): void;
SessionStateOutput = {
state: Session State
reason: string
}

Session State is of type enum which contains following values.
  • init
  • registered
  • running
  • paused
  • suspended
  • terminated
  • stopped
  • completed
Client Usage (Function):
// Promise-based
try {
const sessionOutput = await Proview.session.resume("Break time over");
console.log('Session resumed:', sessionOutput.state);
} catch (err) {
console.error('Failed to resume session:', err);
}

// Callback-based
Proview.session.resume("Break time over", (sessionStateOutput, err) => {
if (err) {
console.error('Failed to resume session:', err);
return;
}
console.log('Session resumed:', sessionStateOutput.state);
});

Session Hooks

Session hooks allow you to register event listeners that get triggered when specific session state changes occur. Use the simple Proview.session.on() syntax to listen for events.
Proview.session.on(eventName, callback);

Pause

Triggered when a proctoring session is paused.
Proview.session.on('Pause', (sessionStateOutput) => {
  // Handle session pause
});
Proview.session.on('Pause', (sessionStateOutput) => {
console.log('Session paused:', sessionStateOutput.state);
console.log('Pause reason:', sessionStateOutput.reason);
});
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed

Resume

Triggered when a paused proctoring session is resumed.
Proview.session.on('Resume', (sessionStateOutput) => {
  // Handle session resume
});
Proview.session.on('Resume', (sessionStateOutput) => {
console.log('Session resumed:', sessionStateOutput.state);
console.log('Resume reason:', sessionStateOutput.reason);
});
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed

Suspend

Triggered when a proctoring session is suspended due to violations or technical issues.
Proview.session.on('Suspend', (sessionStateOutput) => {
  // Handle session suspension
});
Proview.session.on('Suspend', (sessionStateOutput) => {
console.log('Session suspended:', sessionStateOutput.state);
console.log('Suspension reason:', sessionStateOutput.reason);
});
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed

Terminate

Triggered when a proctoring session is terminated.
Proview.session.on('Terminate', (sessionStateOutput) => {
  // Handle session termination
});
Proview.session.on('Terminate', (sessionStateOutput) => {
console.log('Session terminated:', sessionStateOutput.state);
console.log('Termination reason:', sessionStateOutput.reason);
});
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed

StateChange

Triggered whenever the session state changes.
Proview.session.on('StateChange', (sessionStateOutput) => {
  // Handle any state change
});
Proview.session.on('StateChange', (sessionStateOutput) => {
console.log('Session state changed:', sessionStateOutput.state);
console.log('State change reason:', sessionStateOutput.reason);
});
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed

Removing Event Listeners

Use the off method to remove event listeners:
// Remove specific listener
Proview.session.off(eventName, callback);
// Create handler function
const handleSessionPause = (sessionStateOutput) => {
console.log('Session paused:', sessionStateOutput.state);
};

// Add the listener
Proview.session.on('Pause', handleSessionPause);

// Later, remove the specific listener
Proview.session.off('Pause', handleSessionPause);
SessionStateOutput = {
state: SessionState,
reason: string
}
SessionState enum values:
  • init - Session initialized
  • registered - Session registered
  • running - Session actively running
  • paused - Session paused
  • suspended - Session suspended
  • terminated - Session terminated
  • stopped - Session stopped
  • completed - Session completed