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

# Discussions

> List, post, and delete comments on a lab's discussion thread.

Each lab has a discussion thread for your learners.

## List comments

```ts theme={null}
const page = await cybr.labs.listComments({ labId, learnerId, limit: 20 })
```

The page contains `comments`, `nextCursor`, and `totalCount`. Pass `nextCursor` as `cursor` for the next page; it is `null` on the last page.

Each comment has an `id`, `authorName`, `body`, `createdAt`, `ownedByViewer`, `deleted`, and `replies`. `ownedByViewer` is true for the learner you passed, so you can show a delete action.

## Post a comment or reply

```ts theme={null}
const comment = await cybr.labs.createComment({
  labId,
  learnerId,
  displayName: user.name,
  body: 'The policy simulator tip helped me.'
})

await cybr.labs.createComment({
  labId,
  learnerId,
  displayName: user.name,
  body: 'Thanks!',
  parentId: comment.id
})
```

Take `displayName` from your signed-in session, never from the browser. Replies go on top-level comments.

## Delete a comment

```ts theme={null}
await cybr.labs.deleteComment({ labId, learnerId, commentId: comment.id })
```

Learners can delete only their own comments.

## Limits

| Input | Limit |
| - | - |
| Comment body | 1 to 2,000 characters after trimming |
| Display name | Truncated to 80 characters |
| Page size | 20 by default, 50 at most |
| Learner ID | 500 characters at most |

Each comment includes at most 50 replies, without a separate cursor. Discussion requests have their own rate limits, separate from launches.


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