> ## Documentation Index
> Fetch the complete documentation index at: https://docs.endstate.io/llms.txt
> Use this file to discover all available pages before exploring further.

# useCanVault

> The brand's default vault for the tapped item and whether it can be vaulted now, read once per tap session.

```ts theme={null}
function useCanVault(): {
  canVault: () => Promise<VaultEligibility>;
  data: VaultEligibility | null;
  status: "idle" | "loading" | "ready" | "error";
  error: Error | null;
};
```

Reads `GET /v1/units/{unit_id}/vault-eligibility` with the active tap session
once per session, and again whenever you call `canVault()`. A `vault()` or
`cancelVault()` reads it again before it resolves, and every `useCanVault`
shows the newest answer. Use it to word the
prompt, such as "Vault this item with Alliance Vault?", and pass its
`vault.id` to [`useVault`](https://docs.endstate.io/sdks/web/reference/react/useVault).

## Example

```tsx theme={null}
"use client";
import { useCanVault } from "@endstate-sdk/web/react";

function VaultOffer() {
  const { data } = useCanVault();
  if (!data?.vaultable || !data.vault) return null;
  return <p>Vault this item with {data.vault.name}?</p>;
}
```

## Returns

**data** `VaultEligibility | null`

`{ vaultable, vault, requestId }`. `vault` is the brand's default vault,
`{ id, name }`, or `null` when the brand has none. `vaultable` is true when
the item can go there now: false while it has an open vault request or is
vaulted. `requestId` is the request its owner can still cancel, which a page
passes to [`useCancelVault`](https://docs.endstate.io/sdks/web/reference/react/useCancelVault) after
a reload, or `null` when there is none.

**status** `"idle" | "loading" | "ready" | "error"`

`"idle"` without a tap session, `"loading"` while it reads, then `"ready"` or
`"error"`. A new tap reads as `"loading"` until its own answer lands.

**canVault** `() =\> Promise\<VaultEligibility\>`

Reads again for the current tap. Throws when there is no active session.

**error** `Error | null`

The failure that moved `status` to `"error"`, such as `not_found.resource`
when vaulting is not enabled for this environment.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.