<!-- source-hash: 0cad99bc77f5a6b497a57ffae290c55d -->
React hook that binds access-code endpoint URLs from `EndpointsRuntimeContext` to the pure `access-code-client` utilities, exposing loading-state-aware wrappers for validating and consuming access codes without requiring callers to manage endpoint plumbing.

## Key Components

### `useAccessCodeIntegration()`

The sole export. Reads endpoints from `useRequiredEndpointsRuntime()` (throws if no provider is mounted) and returns:

| Field | Type | Description |
|---|---|---|
| `validate` | `(email, code) => Promise` | Validates the code without consuming it |
| `consume` | `(email, code) => Promise` | Consumes the code without re-validating |
| `validateAndConsume` | `(email, code) => Promise` | One-step validate-then-consume |
| `isValidating` | `boolean` | A validate call is in flight |
| `isConsuming` | `boolean` | A consume call is in flight |
| `isProcessing` | `boolean` | Convenience alias: `isValidating \|\| isConsuming` |

> **Note:** The returned functions and object are **not memoized** — they are re-created each render. Wrap with `useCallback` / `useMemo` at the call site if stable identities are needed in effect dependency arrays.

## Usage Example

```typescript
const { validate, consume, validateAndConsume, isProcessing } =
  useAccessCodeIntegration();

const handleRegistration = async (formData: RegistrationForm) => {
  const result = await validate(formData.email, formData.accessCode);

  if (!result.valid) {
    setError(result.message);
    return;
  }

  const registration = await registerUser(formData);

  if (registration.success) {
    await consume(formData.email, formData.accessCode);
  }
};

// Or as a single atomic operation:
const handleInviteFlow = async (email: string, code: string) => {
  const result = await validateAndConsume(email, code);
  if (!result.valid) setError(result.message);
};
```

Use `isProcessing` to disable submit buttons or show spinners during any in-flight operation, and `isValidating` / `isConsuming` independently when the UI distinguishes between the two phases.