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

## Installation

### Script tag

Place the loader as the **last script** on any page that needs Proview SDK. The loader attaches itself globally as `window.Proview`.

```html theme={null}
<!-- load the hosted bundle -->
<script
  src="https://sdk.tlv.cx"
  async
  crossorigin="anonymous"
></script>
```

## Initialize

Define `window.proviewOnLoad` before loading the script. The SDK fires this callback when it is ready. Call `Proview.init` inside the callback to bootstrap the SDK.

Pass a `modules` array of factory calls to declare which modules to load. Each factory is a function exposed on the `Proview` namespace. The `dsn` and `credential` declared at the top level are inherited by all modules — you do not need to repeat them per module.

Omit `modules` entirely and the session module is loaded by default. Pass a `modules` array and **only** the modules you list are loaded — `Proview.session()` included, which must then be named explicitly.

```html theme={null}
<script>
  window.proviewOnLoad = async function () {
    Proview.onError(function (err) {
      console.error('Proview SDK error', err);
    });

    const success = await Proview.init({
      dsn: 'YOUR_PROJECT_DSN',
      credential: Proview.auth.FirebaseAuthStrategy({ token: 'your-token' }),
      modules: [
        Proview.session(),
      ],
    });

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

<!-- Load the SDK after defining the callback -->
<script
  src="https://sdk.tlv.cx"
  async
  crossorigin="anonymous"
></script>
```

### Choosing an auth strategy

`credential` takes a strategy from the `Proview.auth` namespace. The auth module loads automatically — you do not declare it in `modules`.

| Strategy | Used by |
| - | - |
| `Proview.auth.DefaultAuthStrategy()` | The implicit default, applied when `credential` is omitted. Sufficient for `session()`. |
| `Proview.auth.TokenAuthStrategy({ token })` | `playback()` — required. |
| `Proview.auth.FirebaseAuthStrategy({ token })` | Integrations already authenticating users through Firebase. |

See [Authentication](/sdk/authentication) for each strategy in full.

## Interfaces

The Proview SDK is composed of the following modules. Each is declared in the `modules` array using its factory function:

* `Proview.form()` – enables dynamic form loading and submission with integrated authentication. See the [Form](/sdk/forms) guide for details.
* `Proview.scheduler()` – manages interview scheduling, RSVP, and availability with integrated authentication. See the [Scheduler](/sdk/scheduler) guide for complete API reference.
* `Proview.session()` – enables remote proctoring with session management, media capture, and real-time monitoring. Candidate-facing. See the [Proctoring](/sdk/proctoring/getting-started) guide for complete setup instructions.
* `Proview.playback()` – enables embedding and playback of recorded sessions. Interviewer/reviewer-facing. See the [Playback](/sdk/session/playback) guide for integration details.

## Global Error Handling

Register a global error hook **before** calling `Proview.init()` so that initialization failures are captured too. The handler receives a single `ProviewError` object.

```ts theme={null}
interface ProviewError {
  code: string;                              // stable identifier for the failure
  type: 'critical' | 'warning' | 'info';     // severity
  message: string;                           // human-readable reason, for logs
  validationErrors?: CustomValidationError;  // only on schema-validation failures
}
```

```js theme={null}
Proview.onError(function (err) {
  console.error('Proview SDK error', err.type, err.code, err.message);

  switch (err.code) {
    case 'AUTH_ERROR':
    case 'UNAUTHORIZED':
      // credential rejected — fetch a fresh token and re-initialize
      break;
    case 'NETWORK_ERROR':
      // transient — surface a connectivity message and allow a retry
      break;
  }

  if (err.type === 'critical') {
    showUserNotification('A technical issue occurred. Please contact support.');
  }
});
```

See the [Error Reference](/sdk/errors) for every code, what triggers it, and how to handle each one.

<Note>
  `Proview.onError` supports a **single** handler — registering a new one replaces the previous. If several parts of your app need to react to SDK errors, fan out from inside one handler.
</Note>

## Next steps

* [Authentication](/sdk/authentication) — credential strategies and which module uses which
* [Error Reference](/sdk/errors) — every error code, its meaning, and how to handle it
* [Troubleshooting](/sdk/troubleshooting) — diagnose loading, initialization, and auth failures
* [Best Practices](/sdk/best-practices) — loading, credentials, and error-handling guidance that applies to every module


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