> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cybr.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs cover learner integrations through Hosted Lab Pages, the SDK, and the REST API. Content management is outside this integration scope.
> Read the setup page for the chosen approach before implementing it. Keep organization API keys and hosted mint secrets on the server.
> Install the SDK with `npm install @cybr/labs-sdk`. It runs on the server; the `/terminal`, `/terminal/xterm`, `/video`, and `/hosted-browser` entry points run in the browser.
> Cybr provides completion tracking and CTF verification. The integrating platform decides whether to award points.

# Helpers

> normalizeOutputs, createGuestLearnerId, and the video URL helpers.

## Outputs

### `normalizeOutputs(outputs)`

Takes a ready deployment's `outputs` and returns `NormalizedOutputs`. It accepts bare values and `{ value, sensitive }` wrappers, drops values meant only for Cybr, and never throws on a malformed value. `null` or `undefined` returns empty lists.

```ts theme={null}
import { normalizeOutputs } from '@cybr/labs-sdk'

const { rows, console: signIn, awsCredentials, webApps, other } = normalizeOutputs(ready.outputs)
```

| Field | Type |
| - | - |
| `rows` | `OutputRow[]`: every output a learner should see, ordered for display |
| `console` | `{ url?, username?, password? }`, optional |
| `awsCredentials` | `{ accessKeyId, secretAccessKey, sessionToken?, region? }`, optional |
| `webApps` | `{ name, url }[]` |
| `other` | `{ key, value, sensitive }[]`: outputs not sorted into the fields above |

`OutputRow` has `key`, `label`, `value`, `secret`, `sensitive`, and `kind`. The [launch guide](/guides/launching-labs#show-connection-details) explains each one. `OutputRowKind` is the type of `kind`.

## Learners

### `createGuestLearnerId(prefix?)`

Returns a new guest learner ID: `<prefix>_<uuid>`. The prefix defaults to `guest` and accepts 1 to 64 letters, digits, underscores, or hyphens. Other prefixes throw `TypeError`.

```ts theme={null}
import { createGuestLearnerId } from '@cybr/labs-sdk'

const guestId = createGuestLearnerId('acme_guest')
```

Call it on your server and keep the result in an httpOnly cookie. See [guest learners](/guides/learners-and-membership#guest-learners).

## Videos

### `videoEmbedUrl(video)`

Returns the iframe `src` for a `LabVideo`, on the provider's privacy-enhanced player, starting at `startSeconds` when set. Returns `null` for an unknown provider or a malformed ID.

### `videoWatchUrl(video)`

Returns a link to the video on the provider's own site, or `null` in the same cases.

```ts theme={null}
import { videoEmbedUrl, videoWatchUrl } from '@cybr/labs-sdk/video'
```

`@cybr/labs-sdk/video` makes no requests and is safe to bundle into a web page. It also exports the `LabVideo` and `VideoProvider` types.


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