# @capacitor-community/keep-awake

> Prevent your screen from getting some sleep!

Latest version **8.0.1** (published 2026-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @capacitor-community/keep-awake
pnpm add @capacitor-community/keep-awake
yarn add @capacitor-community/keep-awake
bun add @capacitor-community/keep-awake
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2026-04-16 |
| First published | 2020-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 37.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 176 |
| Author | Kevin Boosten |
| Maintainers | jcesarmobile, vmfo, maxlynch, mhartington, it_mike_s, byrds, rdlabo, priyankpatel, dwieeb, stewan, arielhernandezmusa, jeepq, start9keagan, boosten, nklayman, ihadeed, danielprrazevedo, ckgaparajita, jpender, nhyatt, pwespi, epicshaggy, thomasvidas, robingenz, diachedelic, johnborges, tobyas, elylucas, giodimiliaionic, brownoxford, mrbatista, bazuka5801, hemang, thegnuu, pbowyer, capcombot, rui.mendes, ndr, alexgerardojacinto, tafelnl, os-pedrobilro, dallasjames, ryaa, nkalupahana, ionicjs, multishiv19, peitschie, damiantarnawsky, harvdoggy, capacitor-plugin-bot, eric-ionic, os-ruialves |
| Keywords | capacitor, plugin, native |

## Links

- npm: https://www.npmjs.com/package/@capacitor-community/keep-awake
- Repository: https://github.com/capacitor-community/keep-awake
- Homepage: https://github.com/capacitor-community/keep-awake#readme
- Issues: https://github.com/capacitor-community/keep-awake/issues
- npm.io page: https://npm.io/package/@capacitor-community/keep-awake

## Recent versions

- 8.0.1 (latest) — 2026-04-16
- 5.0.1-dev.a09f5c3.1738003115 (dev) — 2025-01-27
- 8.0.0 — 2025-12-20
- 7.1.0 — 2025-06-20
- 7.0.0 — 2025-02-07
- 6.0.0 — 2025-01-28
- 5.0.1 — 2024-08-12
- 5.0.0 — 2024-04-16
- 4.0.0 — 2023-05-04
- 3.0.0-dev.a4d5a8d.1683032576 — 2023-05-02
- 3.0.0-dev.4f57a55.1680890143 — 2023-04-07
- 3.0.0 — 2022-08-04
- 2.1.1-dev.1390021.1659192262 — 2022-07-30
- 2.1.1-dev.1658320404 — 2022-07-20
- 2.1.1-dev.0571a4c.1657740344 — 2022-07-13
- … 8 more at https://npm.io/package/@capacitor-community/keep-awake/versions

## README

<p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>
<h3 align="center">Keep Awake</h3>
<p align="center"><strong><code>@capacitor-community/keep-awake</code></strong></p>
<p align="center">
  ⚡️ Capacitor plugin to prevent devices from dimming or locking the screen.
</p>

<p align="center">
  <img src="https://img.shields.io/maintenance/yes/2026?style=flat-square" />
  <a href="https://github.com/capacitor-community/keep-awake/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/actions/workflow/status/capacitor-community/keep-awake/ci.yml?branch=master&style=flat-square" /></a>
  <a href="https://www.npmjs.com/package/@capacitor-community/keep-awake"><img src="https://img.shields.io/npm/l/@capacitor-community/keep-awake?style=flat-square" /></a>
<br>
  <a href="https://www.npmjs.com/package/@capacitor-community/keep-awake"><img src="https://img.shields.io/npm/dw/@capacitor-community/keep-awake?style=flat-square" /></a>
  <a href="https://www.npmjs.com/package/@capacitor-community/keep-awake"><img src="https://img.shields.io/npm/v/@capacitor-community/keep-awake?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors-"><img src="https://img.shields.io/badge/all%20contributors-2-orange?style=flat-square" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
</p>

## Maintainers

| Maintainer    | GitHub                                          | Social                                            |
| ------------- | ----------------------------------------------- | ------------------------------------------------- |
| Kevin Boosten | [kevinboosten](https://github.com/kevinboosten) | [@kevinboosten](https://twitter.com/kevinboosten) |
| Robin Genz    | [robingenz](https://github.com/robingenz)       | [@robin_genz](https://twitter.com/robin_genz)     |

## Installation

```shell
npm install @capacitor-community/keep-awake
npx cap sync
```

## Configuration

No configuration required for this plugin.

## Demo

A working example can be found in example-app folder.

## Usage

```typescript
import { KeepAwake } from '@capacitor-community/keep-awake';

const keepAwake = async () => {
  await KeepAwake.keepAwake();
};

const allowSleep = async () => {
  await KeepAwake.allowSleep();
};

const isSupported = async () => {
  const result = await KeepAwake.isSupported();
  return result.isSupported;
};

const isKeptAwake = async () => {
  const result = await KeepAwake.isKeptAwake();
  return result.isKeptAwake;
};
```

## API

<docgen-index>

* [`keepAwake()`](#keepawake)
* [`allowSleep()`](#allowsleep)
* [`isSupported()`](#issupported)
* [`isKeptAwake()`](#iskeptawake)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### keepAwake()

```typescript
keepAwake() => Promise<void>
```

Prevent the device from dimming the screen.

--------------------


### allowSleep()

```typescript
allowSleep() => Promise<void>
```

Allow the device to dim the screen.

--------------------


### isSupported()

```typescript
isSupported() => Promise<IsSupportedResult>
```

Whether keep awake is supported or not.

**Returns:** <code>Promise&lt;<a href="#issupportedresult">IsSupportedResult</a>&gt;</code>

--------------------


### isKeptAwake()

```typescript
isKeptAwake() => Promise<IsKeptAwakeResult>
```

Check if the device is kept awake.

**Returns:** <code>Promise&lt;<a href="#iskeptawakeresult">IsKeptAwakeResult</a>&gt;</code>

--------------------


### Interfaces


#### IsSupportedResult

| Prop              | Type                 |
| ----------------- | -------------------- |
| **`isSupported`** | <code>boolean</code> |


#### IsKeptAwakeResult

| Prop              | Type                 |
| ----------------- | -------------------- |
| **`isKeptAwake`** | <code>boolean</code> |

</docgen-api>

## Changelog

See [CHANGELOG.md](https://github.com/capacitor-community/keep-awake/blob/master/CHANGELOG.md).

## License

See [LICENSE](https://github.com/capacitor-community/keep-awake/blob/master/LICENSE).

---
_Source: https://npm.io/package/@capacitor-community/keep-awake · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
