> ## 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.

# Getting Started

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

## Prerequisites

* Talview-provisioned tenant + project DSN. You get a separate DSN per environment (dev / staging / prod).
* 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://sdk.tlv.cx;
  style-src 'unsafe-inline';
  connect-src 'self' https://*.googleapis.com https://*.talview.com wss://*.talview.com https://*.talview.app wss://*.talview.app https://*.firebasedatabase.app wss://*.firebasedatabase.app;
  img-src 'self' https://sdk.tlv.cx;
  frame-src 'self' https://*.talview.app https://*.tlv.cx;
```

## 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.

```html theme={null}
<!-- 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://sdk.tlv.cx/session/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.session.init` after the loader fires. All options are optional; identifiers can be supplied now or later via `Proview.session.start`.

```html theme={null}
<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.session.init({
      dsn: 'YOUR_PROJECT_DSN',              // required
      identifier: 'attempt_789',            // required
      attendee: {                           // required
        identifier: 'candidate_123',        // required
        first_name: 'James',
        last_name: 'Handerson',
        email: 'james.handerson@gmail.com',
      },
      workflow_step: {                      // required
        identifier: 'exam_456',             // required
        name: 'Applied Science - Paper 1',
        duration: 60,
        flow_uuid: '3f9a1c7e-2b4d-4e8a-9c1f-7d5e6a8b0c21',
      },
    });

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

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

> `workflow_step.flow_uuid` *(optional)* is the proctoring configuration identifier for the provided `dsn`.
>
> **Please note:** if the workflow step is already created with a flow, this will not override it.

### Host checklist

* Ensure `dsn` is set; `session.init` rejects with `Missing DSN` otherwise (see `InitConfigSchema` in the SDK).
* Provide `attendee` (with `identifier`), `workflow_step` (with `identifier`), and a top-level `identifier` — all required — during `session.init`.
* Do **not** gate your own UI on the loader script—wait for the session to enter the `MONITORING_IN_PROGRESS` 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.

```html theme={null}
<button id="start-exam">Start Exam</button>
<script>
  document.getElementById('start-exam').addEventListener('click', async function () {
    try {
      await Proview.session.start();
      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>
```

## 4. Stop / complete / pause / resume

The session module mirrors the methods listed in [Configuration](/sdk/proctoring/configuration):

```js theme={null}
// 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.

## Next steps

* [Playback](/sdk/session/playback) — replay a recorded session in your reviewer-facing app
* [Troubleshooting](/sdk/troubleshooting) — loading, init, auth, and permission failures
* [Best Practices](/sdk/best-practices) — guidance that applies to every module


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.