[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/inertia](../README) / encryptHistory

# Function: encryptHistory()

> **encryptHistory**(`on?`): `void`

Defined in: [inertia/src/historyState.ts:52](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/inertia/src/historyState.ts#L52)

Encrypt the current page's history state in the browser (protects props cached in
`history.state` for a page holding sensitive data). Effective for the current request.

## Parameters

### on?

`boolean` = `true`

Pass `false` to opt this page out when encryption is the global default. Default `true`.

## Returns

`void`

## Example

```ts
async show(http: HttpContext): Promise<void> {
  Inertia.encryptHistory();
  return inertia('Account/Settings', { account });
}
```
