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

# Embedded wallets: setup & creation

> The React SDK auto-created embedded wallets during its login flow. In the JavaScript SDK you decide when to create them and for which chains — the full build lives in the Building UI post-login guide.

In the React SDK, embedded (WaaS) wallets were created for you: the widget's onboarding flow (`useSyncEmbeddedWalletFlow`) ran after login and, when the project had automatic creation enabled, provisioned a wallet without any code on your side. The JavaScript SDK removes that implicit step — you call `createWaasWalletAccounts` yourself, after checking whether the user still needs a wallet.

## What maps to what

| React SDK                                            | JavaScript SDK                                                     |
| ---------------------------------------------------- | ------------------------------------------------------------------ |
| automatic creation via `useSyncEmbeddedWalletFlow`   | you call `createWaasWalletAccounts({ chains })` after login        |
| `useDynamicWaas().createWalletAccount(requirements)` | `createWaasWalletAccounts()` / `useCreateWaasWalletAccounts()`     |
| `useEmbeddedWallet().userHasEmbeddedWallet()`        | `getChainsMissingWaasWalletAccounts()` (empty → nothing to create) |
| project setting "automatic embedded wallet creation" | `shouldAutoCreateWalletForChain({ chain })`                        |
| widget checked WaaS availability internally          | `isDynamicWaasEnabled()`                                           |

## What's missing for this user?

Before creating anything, confirm WaaS is enabled and find the chains the user doesn't have a wallet for yet. `getChainsMissingWaasWalletAccounts()` returns exactly the chains you should create — an empty array means the user is already set up.

```typescript theme={"system"}
import {
  isDynamicWaasEnabled,
  getChainsMissingWaasWalletAccounts,
} from '@dynamic-labs-sdk/client/waas';

if (isDynamicWaasEnabled()) {
  const missingChains = getChainsMissingWaasWalletAccounts();
  // missingChains is e.g. ['EVM', 'SOL'] — empty when nothing to create.
}
```

## Reproducing the auto-create behavior

The one thing that changes for migrating apps is that nothing creates the wallet for you anymore. To keep the React SDK's "create on login automatically" behavior, run the check-and-create step yourself once the user is authenticated. `shouldAutoCreateWalletForChain({ chain })` mirrors the project setting the widget used to read.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={"system"}
    import {
      shouldAutoCreateWalletForChain,
      createWaasWalletAccounts,
      getChainsMissingWaasWalletAccounts,
    } from '@dynamic-labs-sdk/client/waas';

    // Call this after login resolves.
    async function autoCreateWallets() {
      const chains = getChainsMissingWaasWalletAccounts().filter((chain) =>
        shouldAutoCreateWalletForChain({ chain }),
      );
      if (chains.length > 0) await createWaasWalletAccounts({ chains });
    }
    ```
  </Tab>

  <Tab title="React">
    ```tsx theme={"system"}
    import {
      shouldAutoCreateWalletForChain,
      getChainsMissingWaasWalletAccounts,
    } from '@dynamic-labs-sdk/client/waas';
    import { useCreateWaasWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
    import { useEffect } from 'react';

    function useAutoCreateWallets(isAuthenticated: boolean) {
      const { mutate: createWallets } = useCreateWaasWalletAccounts();

      useEffect(() => {
        if (!isAuthenticated) return;
        const chains = getChainsMissingWaasWalletAccounts().filter((chain) =>
          shouldAutoCreateWalletForChain({ chain }),
        );
        if (chains.length > 0) createWallets({ chains });
      }, [isAuthenticated, createWallets]);
    }
    ```
  </Tab>
</Tabs>

<Note>
  When your project protects WaaS wallets with a password, collect it first (`isPasswordRequiredForWaasWallets()`) and pass it to `createWaasWalletAccounts({ chains, password })` — the same password protects every WaaS wallet the user has. See Embedded wallets: password & security.
</Note>

## Building it

Wallet creation is one step of the wider post-login setup, so the full build — the on-demand "Create wallet" button, password handling, and error cases — lives in the Building UI guide: [**Post-login user setup → Embedded wallet step** (Building UI)](/docs/javascript/building-ui/post-auth-user-setup#embedded-wallet-step).

## See also

* Embedded wallets: password & security — collecting and managing the WaaS password
* [Post-login user setup](/docs/javascript/migrating-from-react/post-login-user-setup) — where wallet creation fits in the post-login sequence
* Upgrading embedded wallets — migrating older embedded wallets to Dynamic WaaS
