Labs
submitFlag() and submitGuideAnswer() return { correct, verdict }. The REST responses use { message } for those verdicts.
markCompleted() returns { message: 'COMPLETED' }. The completion guide explains verification and duplicate results.
Lab content types
Lab contains identity, name, description, provider, time limit, membership tier, and content indicators. provider is aws or azure.
LabDetails adds learner completion and the guide, resources, diagrams, videos, and other optional content. List and detail fields can differ.
The package exports LabGuide, GuideTask, GuideQuestion, LabResourceLink, LabDiagram, and LabVideo. The content guide explains their use.
Discussions
The SDK sendslearnerId through the x-cybr-learner-id header. Your server resolves that ID from the learner session.
nextCursor is null at the last page. Replies use parentId from a top-level comment. Delete requires ownership.
Discussion inputs have these limits:
- Comment body: 1 to 2,000 Unicode code points after normalization and trimming.
- Display name: Truncated to 80 Unicode code points after normalization.
- Page size: 20 by default, with a maximum of 50.
- Learner ID: At most 500 Unicode code points after trimming.
Resource links
labs.get() returns available supporting links in LabDetails.resources. The value is a plain list or null.
Each link includes an id, type, title, and url. A link can also include a description.
Your interface can show these links alongside the lab guide. labs.list() provides hasResources without the full link list.
Deployments
membership defaults to free in the SDK. sourceIp is optional and applies only to labs that use it.
Deployment handles
Bothlaunch() and get() return a handle with id and version: 'v2'. The handle exposes these methods:
get() makes no network request. It creates a handle for an existing ID.
Readiness polling
waitUntilReady() accepts these fields:
The result is
{ status: 'complete', outputs }. A failed or ended deployment throws deployment_failed.
The method checks the deadline after each status request. An in-flight request can exceed that deadline.
The signal stops later polls and cancels the sleep between polls. It does not cancel an in-flight status request.
If that request returns ready, the method can resolve despite an abort or elapsed deadline. The cancellation checks before polls and during sleeps throw aborted.
Cancellation does not end the deployment. The HTTP client’s timeout and retry settings still apply to each status request.
Status and run types
DeploymentRun includes id, deploymentId, action, status, exitCode, outputs, error, and timestamps.
Run actions are apply, destroy, or clean. Run states are queued, running, completed, or errored.
See errors for SDK errors and terminals for terminal types.