Skip to main content
Welcome to the Proview SDK (v8). Follow these steps to embed the latest SDK in your application.

Prerequisites

  • Talview-provisioned tenant + project DSN (customer success or Talview Sales can help).
  • Modern browser with WebRTC support and HTTPS hosting for your delivery app.
  • Ability to add a script tag and a small bootstrap snippet wherever proctoring needs to run.

Content Security Policy (CSP)

If your application enforces CSP headers, allow the domains and inline resources required by the SDK:
Content-Security-Policy:
  script-src 'unsafe-inline' https://*.proview.io;
  style-src 'unsafe-inline';
  connect-src 'self' https://*.googleapis.com https://*.talview.com wss://*.talview.com;
  img-src 'self' https://*.proview.io;

1. Load the SDK once

Place the loader as the last script on any page that needs proctoring. The loader attaches itself globally as window.Proview and fires window.proviewOnLoad when ready.
<!-- 1. define the onLoad hook before loading the script -->
<script>
  window.proviewOnLoad = function () {
    console.info('Proview SDK ready');
  };
</script>

<!-- 2. load the hosted bundle -->
<script
  src="https://prod.proview.io/init.js"
  async
  crossorigin="anonymous"
></script>
Use the environment-specific loader URL shared during onboarding (dev / staging / prod). The example above targets the production CDN.

2. Initialise once per page view

Call Proview.init after the loader fires. The dsn is mandatory; identifiers can be supplied now or later via setAttendee / setWorkflow.
<script>
  window.proviewOnLoad = async function () {
    Proview.onError(function (err) {
      console.error('Proview SDK error', err);
      // TODO: surface user-friendly error, send telemetry, etc.
    });

    const success = await Proview.init({
      dsn: 'YOUR_PROJECT_DSN',
      attendee_identifier: 'candidate_123', // optional; set now or later
      workflow_identifier: 'exam_456', // optional; set now or later
      session_identifier: 'attempt_789', // optional; auto-generated if omitted
    });

    if (!success) {
      console.error('Proview failed to initialize');
      return;
    }

    // Optional: restrict languages after init
    Proview.locale.limitLanguages(['en', 'fr']);
  };
</script>

Host checklist

  • Ensure dsn is set; init rejects with Missing DSN otherwise (see InitConfigSchema in the SDK).
  • Provide attendee_identifier, workflow_identifier, and (optionally) session_identifier during init, or defer them to Proview.setAttendee / Proview.setWorkflow / Proview.session.start (next section).
  • Do not gate your own UI on the loader script—wait for the session to enter the running state (next section).

3. Start the proctoring session before showing the assessment

Trigger the session start from your own UI (for example, a “Start Exam” button) once the candidate is ready. Wait for the promise to resolve before displaying your assessment content.
<button id="start-exam">Start Exam</button>
<script>
  document.getElementById('start-exam').addEventListener('click', async function () {
    try {
      await Proview.session.start({
        attendee_identifier: 'candidate_123', // optional if provided earlier
        workflow_identifier: 'exam_456', // optional if provided earlier
        session_identifier: 'attempt_789', // optional; auto-generated if omitted
      });
      console.log('Proview session running');
      // TODO: reveal your assessment content now that proctoring is active
    } catch (err) {
      console.error('Unable to start proctoring', err);
    }
  });
</script>
When you call Proview.session.start, the SDK first reuses any identifiers already set during Proview.init / Proview.setAttendee / Proview.setWorkflow. Pass whichever fields are still missing in the start options. If session_identifier is still undefined after both steps, the SDK derives one by combining the attendee and workflow identifiers.

4. Stop / complete / pause / resume

The session module mirrors the methods listed in sdk/configuration:
// Stop without submitting the exam
await Proview.session.stop();

// Mark exam as completed (idempotent)
await Proview.session.complete();

// Pause with a reason (required)
await Proview.session.pause('Scheduled break');

// Resume after a break
await Proview.session.resume('Break over');
All operations update the local session context and invoke your onError handler on failure. When rolling out pause/resume, consider mapping them to your own assessment timers as well.

5. Troubleshooting quick tips

  • Missing DSN: confirm the value passed into Proview.init. The SDK validates the configuration and rejects empty strings.
  • No UI rendered: ensure Proview.session.start() ran successfully and that a valid attendee/workflow identifier exists in context.
  • Permission prompts not appearing: the host page must not override camera/mic permissions (see best practices). Verify using your browser’s developer tools.
  • Network disconnects: listen for your own connectivity changes and optionally call Proview.session.pause() so the candidate is aware.