# Getting started with JS

{% hint style="info" %}
We are in the process of migration to new Execution Layer architecture and SDK will be updated accordingly. Right now SDK supports only Ditto Vaults (legacy). Please contact us at <into@dittonetwork.io> if you have interest as there are dramatic changes on the horizon.
{% endhint %}

### Installation

To install the SDK, use the following commands:

```bash
npm install @ditto-network/core @ditto-network/web3.js web3
```

### Getting Started

Here’s a quick guide to get you started with the Ditto Network SDK:

#### Initialize SDK

```javascript
import { Provider, SmartWalletFactory, BrowserStorage } from '@ditto-network/core';
import { EthersSigner, EthersContractFactory } from '@ditto-network/ethers';

const provider = new Provider({
  signer: new EthersSigner(signer),
  storage: new BrowserStorage(),
  contractFactory: new EthersContractFactory(signer),
});
const swFactory = new SmartWalletFactory(provider);

const sw = await swFactory.getDefaultOrCreateVault();
const vaultAddress = sw.getAddress();

console.log('Vault address:', vaultAddress);
```

For more detailed examples, check the examples section.

### Documentation

For comprehensive documentation and details on how to use the Ditto Network, please refer to the main documentation in the [`@ditto-network/core`](https://github.com/dittonetwork/sdk-js/blob/master/packages/core/README.md) package.

### Examples

We provide a variety of examples to help you get started with different environments:

* **Node.js Examples**: Located in the [`examples/nodejs-example`](https://github.com/dittonetwork/sdk-js/tree/master/examples/nodejs-example) directory.
* **React Examples**: Located in the [`examples/react-example`](https://github.com/dittonetwork/sdk-js/tree/master/examples/react-example) directory.
* **Sandbox**: Located in the [`examples/sandbox`](https://github.com/dittonetwork/sdk-js/tree/master/examples/sandbox) directory.
