[API reference](https://evolu.dev/docs/api-reference) › [@evolu/web](https://evolu.dev/docs/api-reference/web) › PasskeyAuth

Defined in: [packages/web/src/local-first/Passkey.ts:55](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/web/src/local-first/Passkey.ts#L55)

Unlocks the app's DeviceSecret with a passkey; see [createPasskeyAuth](https://evolu.dev/docs/api-reference/web/functions/createPasskeyAuth).

## Extends

- [`AsyncDisposable`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management)

## Properties

<a id="startover"></a>

### startOver

```ts
readonly startOver: (options: {
  confirm: () => boolean | Promise<boolean>;
}) => Promise<void>;
```

Defined in: [packages/web/src/local-first/Passkey.ts:83](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/web/src/local-first/Passkey.ts#L83)

Forgets the stored DeviceSecret or a setup's pending key, so the next
[PasskeyAuth.unlock](https://evolu.dev/docs/api-reference/web/interfaces/PasskeyAuth#unlock) creates another passkey and DeviceSecret, and
resolves once the state says how it went. Call it while the state is
`Failed` with `canStartOver`. A pending key wrapped no secret, so it's
forgotten without asking; a stored secret is forgotten only once `confirm`,
such as the app's dialog, returns true, because its device database's
accounts then come back only from their backups. A `confirm` that throws or
rejects, as a dialog library can when the user dismisses it, declines: the
Run's `reportDefect` reports its error, and starting over stays offered.

---

<a id="state"></a>

### state

```ts
readonly state: ReadonlyStore<PasskeyAuthState>;
```

Defined in: [packages/web/src/local-first/Passkey.ts:62](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/web/src/local-first/Passkey.ts#L62)

What the app shows: not persisted, locked, unlocking, failed, starting
over, or unlocked. A listener that throws doesn't stop an unlock or a start
over: the Run's `reportDefect` reports its error, and the state changes
anyway.

---

<a id="unlock"></a>

### unlock

```ts
readonly unlock: () => Promise<void>;
```

Defined in: [packages/web/src/local-first/Passkey.ts:70](https://github.com/evoluhq/evolu/blob/aa223771feea747ffb1b0f5f3271574455633e37/packages/web/src/local-first/Passkey.ts#L70)

Unlocks the stored DeviceSecret with its passkey, or on the first use
creates a passkey and a DeviceSecret, and resolves once the state says how
it went. Call it in a user gesture, while the state is `Locked` or
`Failed`.

## Methods

<a id="asyncdispose"></a>

### \[asyncDispose\]()

```ts
[asyncDispose](): PromiseLike<void>;
```

Defined in: node\_modules/@typescript/old/lib/lib.esnext.disposable.d.ts:38

#### Inherited from

`AsyncDisposable.[asyncDispose]`