# `useGuestAuth`

Creates guest accounts for instant onboarding without committing to an authentication method. Guest accounts can later be upgraded to permanent accounts by linking email, OAuth, or wallet authentication.

## Usage

```tsx
import { useGuestAuth } from '@openfort/react-native';

function GuestButton() {
  const { signUpGuest, isLoading } = useGuestAuth({
    onSuccess: ({ user }) => console.log('Guest account created:', user?.id),
    onError: (error) => console.error('Failed to create guest account:', error),
  });

  return <Button title="Try as guest" onPress={() => signUpGuest()} disabled={isLoading} />;
}
```

## Hook options

Pass these options when initializing the hook:

```ts
type GuestHookOptions = {
  onSuccess?: (data: GuestResult) => void
  onError?: (error: OpenfortError) => void
  throwOnError?: boolean
}
```

## Return type

The hook returns the following:

```ts
type GuestAuthReturn = {
  signUpGuest(options?: GuestHookOptions): Promise<GuestResult>
  isLoading: boolean
  isError: boolean
  isSuccess: boolean
  error: OpenfortError | null
}

type GuestResult = {
  user?: User
  error?: OpenfortError
}
```
