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

# Guest Mode

> Allow users to use your app via guest wallets without signing up.

Guest Mode allows you to provision one or more wallets for a new user so they can start using your app without going through the sign-up process.

<Info>
  With Guest Mode enabled, you can offer an option for your users to get started with a guest account without signing up. When users eventually sign up, any previously created guest wallets will immediately be linked to their account.
</Info>

## Integration Methods

There are two primary ways to implement Guest Mode:

<Tabs>
  <Tab title="Para Modal">
    The easiest way to implement Guest Mode is via the Para Modal. Simply set the corresponding configuration setting (`isGuestModeEnabled`) in your `ParaProvider` configuration to `true`.

    This setting adds a "Continue as Guest" option to the modal sign-in screen, which closes the modal and performs wallet setup in the background. If the modal is reopened, guest users will see a special version of the account screen, from which they can proceed to finish signing up and then claim their existing wallets.

    <CodeGroup>
      ```tsx App.tsx {13} theme={null}
      import { ParaProvider, Environment } from "@getpara/react-sdk";

      function App() {
        return (
          <QueryClientProvider client={queryClient}>
            <ParaProvider
              paraClientConfig={{
                env: 'DEV',
                apiKey: 'yout-api-key'
              }}
              paraModalConfig={{
                // other props omitted for brevity
                isGuestModeEnabled: true,
              }}
              callbacks={{
                // An optional callback invoked after guest wallets are created:
                onGuestWalletsCreated: event => {
                  console.log('Guest wallets created!', event.detail);
                }
              }}
            >
              <AppContent />
            </ParaProvider>
          </QueryClientProvider>
        );
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="React Hook">
    If you are using a custom UI implementation or you would like to enter Guest Mode before your user opens the Para Modal, you can use the `useCreateGuestWallets` hook to create guest wallets programmatically:

    <CodeGroup>
      ```tsx AppContent.tsx theme={null}
      import { useCreateGuestWallets } from "@getpara/react-sdk";

      // This component must be wrapped within a `ParaProvider` to function properly
      function AppContent() {
        const { createGuestWallets, isPending, isError, error } = useCreateGuestWallets();

        const onClickGuestLoginButton = () => {
          createGuestWallets(
            undefined,
            {
              onSuccess: (wallets) => {
                console.log('Guest wallets created, app is now in Guest Mode:', wallets);
              },
              onError: (error) => {
                console.error('Error creating guest wallets:', error);
              },
              onSettled: () => {
                console.log('Guest wallets creation process settled.');
              }
            }
          )
        };

        // ...
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>

### Tracking Guest Wallet Creation

Whether you use the modal or a custom solution, you can monitor and reflect guest wallet creation status by using the `useCreateGuestWalletsState` hook. For example, you will likely want to block any signing-related interface actions until the wallets have been created.

<CodeGroup>
  ```tsx AppContent.tsx theme={null}
  import { useCreateGuestWalletsState } from "@getpara/react-sdk";

  function AppContent() {
    const { isPending: isCreatingGuestWallets, error } = useCreateGuestWalletsState();

    if (error) {
      console.error('Error creating guest wallets:', error);
      return <p>Error creating guest wallets.</p>;
    }

    return (
      <div>
        {isCreatingGuestWallets ? (
          <p>Creating guest wallets...</p>
        ) : (
          <p>Guest wallets created successfully!</p>
        )}
      </div>
    )
  }
  ```
</CodeGroup>

<Tip>
  Due to implementation details of React Query, the `useCreateGuestWallets` hook will not reliably reflect the status of the Para Modal's guest wallet creation process. To monitor the modal operation's status from the rest of your app, you *must* instead use `useCreateGuestWalletsState`. The hook's return type resembles React Query's `UseMutationReturnType` type and has most of the same fields.
</Tip>

## Limitations

Currently, guest wallets are prevented from buying or selling crypto through the integrated onramp providers. If a guest wallet is funded, a message is presented to the user in the Para Modal account screen encouraging them to sign up and retain access to their funds. You are, of course, free to fund guest wallets if you desire, but note that you must be careful to maintain user access to the wallets to ensure no funds are lost.

<Tip>
  We recommend using `getUserShare` and `setUserShare` to save and restore the user share for a guest wallet, just as you would for a pregenerated wallet.
</Tip>
