---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk/extension/functions/createAttempts.md
---
[Reference](../../../../index.md) / [@getenginex/sdk/extension](../index.md) / createAttempts

# createAttempts()

> **createAttempts**(): [`Attempts`](../interfaces/Attempts.md)

Creates the attempt of an idempotent write (at most one open). One per mutation options
object (plain TanStack, Vue, vanilla) or per hook instance (`sdk-react`).

## Returns

[`Attempts`](../interfaces/Attempts.md)

## Example

```ts
const attempts = createAttempts()
const key = attempts.keyFor(input)
try { const r = await call(input, { idempotencyKey: key }); attempts.settle(input); return r }
catch (error) { attempts.settle(input, error); throw error }
```

## Throws

Never throws; `keyFor` may throw `CONFIGURATION_ERROR` without Web Crypto.
