> ## 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.

# Pre-generating Wallets

> Create embedded wallets for users before they authenticate

<Card title="Recommended: JavaScript SDK with React Hooks" icon="react" color="#4779FE">
  For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](/javascript/reference/react-quickstart) to get started.
</Card>

Pre-generated wallets allow you to create embedded wallets for users before they authenticate. This is useful for scenarios where you want to prepare wallets in advance or create wallets for users who haven't logged in yet.

## When to use pre-generated wallets

Use pre-generated wallets when you need to:

* Create wallets for users before they sign up or log in
* Prepare wallets in advance for a batch of users
* Set up wallets for users identified by email, phone, or other identifiers
* Create wallets programmatically from your backend

## Prerequisites

Before creating pre-generated wallets, you need:

1. Your environment ID from the Dynamic dashboard URL
2. A Dynamic API key:
   * Go to **Developers** → **SDK and API Key**
   * Create a new API key with appropriate permissions

## Creating a pre-generated wallet

To create a pre-generated wallet, make a POST request to the Dynamic API:

```javascript theme={"system"}
const response = await fetch('https://app.dynamic.xyz/api/v0/environments/{environmentId}/waas/create', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    identifier: 'user@example.com',
    type: 'email',
    chains: ['EVM']
  })
});

const wallet = await response.json();
console.log('Created wallet:', wallet);
```

### Parameters

| Parameter       | Type   | Required | Description                                                                                                                                                                           |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `environmentId` | string | Yes      | Your Dynamic environment ID (found in the dashboard URL)                                                                                                                              |
| `identifier`    | string | Yes      | The user identifier (email, phone, etc.)                                                                                                                                              |
| `type`          | string | Yes      | The type of identifier, either [a social provider](/api-reference/schemas/SocialSignInProviderEnum) or [another user identifier type](/api-reference/schemas/UserIdentifierTypeEnum). |
| `chains`        | array  | Yes      | [Array of blockchain chains](/api-reference/schemas/WaasChainEnum) to create wallets for (e.g., \["EVM"])                                                                             |

### Response

The API returns the created wallet information including:

* Wallet address
* Chain details
* Wallet ID
* Creation timestamp

## Using pre-generated wallets

Once created, users can claim their pre-generated wallet when they authenticate with the same identifier. The wallet will automatically be associated with their account upon login.

## API reference

For complete API details, see the [Create WaaS Wallet API endpoint](/api-reference/wallets/create-waas-wallet).
