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

# Core

> Reference notes for the top-level @qawolf/testkit entry point.

The top-level package exposes:

* `otp.fromUri(...)`
* `configureTestkitClient(...)`
* `getCurrentTestkitClient(...)`
* `resetTestkitClient(...)`
* `mountCifsShare(...)`
* `startOpenVpn(...)`
* `saveBaselineScreenshot(...)`
* `saveEnvironmentVariable(...)`
* `reloadEnvironmentVariables(...)`

`mountCifsShare(...)`, `startOpenVpn(...)`, and `saveBaselineScreenshot(...)` all require a client configured with `configureTestkitClient(...)` first — see [Client](/libraries/testkit/api-reference/client) for how to create one.

Example:

```ts theme={null}
import {
  configureTestkitClient,
  mountCifsShare,
  otp,
  reloadEnvironmentVariables,
  saveEnvironmentVariable,
  startOpenVpn,
} from "@qawolf/testkit";
import { createTestkitClient } from "@qawolf/testkit/client";

// see Client for how to build this
configureTestkitClient(createTestkitClient(runnerPorts));

const code = otp.fromUri("otpauth://totp/QA%20Wolf?secret=JBSWY3DPEHPK3PXP");

await mountCifsShare({
  mountPoint: "/Volumes/shared",
  password: "secret",
  share: "//server/share",
  username: "wolf",
});

await startOpenVpn({ configPath: "/tmp/test.ovpn" });
await saveEnvironmentVariable("SESSION_TOKEN", "abc123");
await reloadEnvironmentVariables();
console.log(code);
```

## Environment variables

These helpers are intended for QA Wolf runner environments. They require the runner-provided `QAWOLF_API_URL`, `QAWOLF_ENVIRONMENT_ID`, and `QAWOLF_TEAM_API_KEY` environment variables.

Use `saveEnvironmentVariable(name, value)` to save a string value to the current QA Wolf environment and update `process.env[name]` for the running flow.

Use `reloadEnvironmentVariables()` to fetch the latest environment variables for the current QA Wolf environment and copy string values into `process.env`.

```ts theme={null}
import {
  reloadEnvironmentVariables,
  saveEnvironmentVariable,
} from "@qawolf/testkit";

await saveEnvironmentVariable("LOGIN_TOKEN", token);
await reloadEnvironmentVariables();

console.log(process.env["LOGIN_TOKEN"]);
```

## Error behavior

Client-dependent helpers — `mountCifsShare(...)`, `startOpenVpn(...)`, `saveBaselineScreenshot(...)` — throw when no client has been configured:

```ts theme={null}
import { mountCifsShare, resetTestkitClient } from "@qawolf/testkit";

resetTestkitClient();

await mountCifsShare(/* same options as the example above */); // throws: no client configured
```

Environment variable helpers throw when the QA Wolf API configuration is missing or when the API request fails.

`saveBaselineScreenshot(...)` also throws when the configured client does not provide screenshot support — see [Client](/libraries/testkit/api-reference/client#input-ports) for the `saveSnapshot` port that enables it.
