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

# Creating a Dynamic Client

> The first step in using the JavaScript SDK is to create a Dynamic Client

<strong>Important:</strong> All other methods in the JavaScript SDK require a Dynamic client to be created first.

## Installation

```bash theme={"system"}
npm install @dynamic-labs-sdk/client
```

## Usage

Create the client in a module that loads once (for example `dynamicClient.ts` in a React app) and share that instance across your app. The API is the same in React and plain JavaScript.

```javascript theme={"system"}
import { createDynamicClient } from '@dynamic-labs-sdk/client';

const dynamicClient = createDynamicClient({
  environmentId: 'YOUR_ENVIRONMENT_ID',
  metadata: {
    name: 'YOUR_APP_NAME',
    universalLink: 'https://yourapp.com',
    iconUrl: 'YOUR_APP_ICON_URL',
  },
});
```

You can get your environment ID from the [Dynamic dashboard](https://app.dynamic.xyz/dashboard/developer/api).

## Configuration Options

### Basic Options

* `environmentId` (required): Your Dynamic environment ID
* `autoInitialize` (optional): Whether to automatically initialize the client (default: `true`)
* `metadata` (optional): Your app's metadata
  * `name`: The name of your app
  * `universalLink`: The official domain/URL of your app (e.g., `https://yourapp.com`). Used for deep link redirects and as the domain in sign-in message signatures.
  * `iconUrl`: The URL of the icon of your app
  * `nativeLink`: Native deep link for your app (e.g., `myapp://`). Used for app-to-app communication on mobile devices.
* `logLevel` (optional): Logging level for the SDK

### Advanced Options

#### Transformers

Customize SDK data before it's used throughout your application:

```javascript theme={"system"}
const dynamicClient = createDynamicClient({
  environmentId: 'YOUR_ENVIRONMENT_ID',
  transformers: {
    networkData: (network) => {
      // Override RPC URLs
      if (network.networkId === '1') {
        return {
          ...network,
          rpcUrls: {
            http: ['https://eth-mainnet.g.alchemy.com/v2/YOUR-KEY'],
          },
        };
      }
      return network;
    },
  },
});
```

See [Network Transformers](/javascript/reference/networks/network-transformers) for more details.
