---
title: KeepAwakeOptions
description: The options bag for keepAwake.
---

The options bag for `keepAwake`.

## Properties

### idleWindowSec?

```ts
optional idleWindowSec?: number;
```

The VM's `maxIdleDurationSeconds`. A sandbox-held session knows it; otherwise the
platform minimum of 60 is assumed. The interval may be at most half of it.

***

### intervalSec?

```ts
optional intervalSec?: number;
```

Seconds between polls. Default: a third of the idle window, at most 20.

***

### maxDurationSec?

```ts
optional maxDurationSec?: number;
```

End after this many seconds even if still busy.

***

### toleratedErrors?

```ts
optional toleratedErrors?: number;
```

How many retryable poll failures in a row are retried, a second apart, before the
keepalive ends with the error. Default: the core's `DEFAULT_TOLERATED_ERRORS`.

***

### whileBusy?

```ts
optional whileBusy?: boolean;
```

End once no exec is running.

## Provenance

This page is generated from `bindings/microvms-js/index.d.ts` by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from `site/scripts/gen-reference.mjs` on every `pnpm run sync`, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding's Rust source, then regenerate the declarations with `mise run dts`. `mise run dts:check` fails when the committed file no longer matches the source.