> For the complete documentation index, see [llms.txt](/llms.txt).

# PnP No Modal SDK - v5 to v6

## General[​](#general "Direct link to General")

### `web3auth.connected` is introduced[​](#web3authconnected-is-introduced "Direct link to web3authconnected-is-introduced")

#### Manage session using `web3auth.connected` instead of `web3auth.provider`[​](#manage-session-using-web3authconnected-instead-of-web3authprovider "Direct link to manage-session-using-web3authconnected-instead-of-web3authprovider")

With V6, users can manage their session using `web3auth.connected` instead of `web3auth.provider`.

```
// With V6
if (web3auth.connected) {
  setLoggedIn(true)
}

```

### `provider` is now always available[​](#provider-is-now-always-available "Direct link to provider-is-now-always-available")

In V5, we used to add a check for setting the `provider` only if the `web3auth.provider` was present. But now with V6 we always have a provider available even if the user is not logged in.

```
// With V5
if (web3auth.provider) {
  setProvider(web3auth.provider)
}
// With V6
setProvider(web3auth.provider) // before the connect() or connectTo(), provider is available.

```

### `rpcTarget` and `chainId` is now a mandatory parameter[​](#rpctarget-and-chainid-is-now-a-mandatory-parameter "Direct link to rpctarget-and-chainid-is-now-a-mandatory-parameter")

Previously, the Web Modal SDK required `chainConfig` as a parameter which had `rpcTarget` and `chainId` as the optional parameter. But with V6, it's mandatory to add `rpcTarget` and `chainId` in the `chainConfig` object.

```
const web3auth = new Web3Auth({
  clientId,
  chainConfig: {
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: '0x1',
    rpcTarget: 'https://rpc.ethereum.org', // This is the public RPC we have added, please pass on your own custom endpoint while creating an app
  },
  web3AuthNetwork: 'sapphire_mainnet',
})

```

### `privateKeyProvider` is introduced[​](#privatekeyprovider-is-introduced "Direct link to privatekeyprovider-is-introduced")

#### `privateKeyProvider` is now a mandatory parameter to be passed into the `OpenLoginAdapter`[​](#privatekeyprovider-is-now-a-mandatory-parameter-to-be-passed-into-the-openloginadapter "Direct link to privatekeyprovider-is-now-a-mandatory-parameter-to-be-passed-into-the-openloginadapter")

With V6, we have added a new parameter `privateKeyProvider` which is mandatory to be passed into the `OpenLoginAdapter`.

#### For EVM chains[​](#for-evm-chains "Direct link to For EVM chains")

For EVM chains use the `EthereumPrivateKeyProvider` from the `@web3auth/ethereum-provider`package. Please note that`EthereumPrivateKeyProvider`requires`chainConfig`as the `config` parameter at the time of initialization.

```
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider'

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.EIP155,
  chainId: '0x1',
  rpcTarget: 'https://rpc.ethereum.org',
  displayName: 'Ethereum Mainnet',
  blockExplorer: 'https://etherscan.io',
  ticker: 'ETH',
  tickerName: 'Ethereum',
}
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } })
const openloginAdapter = new OpenloginAdapter({
  privateKeyProvider,
})
web3authInstance.configureAdapter(openloginAdapter)

```

#### For Solana[​](#for-solana "Direct link to For Solana")

For Solana use the `SolanaPrivateKeyProvider` from the `@web3auth/solana-provider`package. Please note that `SolanaPrivateKeyProvider` requires `chainConfig` as the `config` parameter at the time of initialization.

```
import { SolanaPrivateKeyProvider } from '@web3auth/solana-provider'

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.SOLANA,
  chainId: '0x1', // Please use 0x1 for Mainnet, 0x2 for Testnet, 0x3 for Devnet
  rpcTarget: 'https://api.mainnet-beta.solana.com',
  displayName: 'Solana Mainnet',
  blockExplorer: 'https://explorer.solana.com',
  ticker: 'SOL',
  tickerName: 'Solana',
}
const privateKeyProvider = new SolanaPrivateKeyProvider({ config: { chainConfig } })
const openloginAdapter = new OpenloginAdapter({
  privateKeyProvider,
})
web3auth.configureAdapter(openloginAdapter)

```

#### For all other chains[​](#for-all-other-chains "Direct link to For all other chains")

For all non-EVM and non-Solana chains, use the `CommonPrivateKeyProvider` from the `@web3auth/base-provider`package. Please note that `CommonPrivateKeyProvider` requires `chainConfig` as the `config` parameter at the time of initialization.

```
import { CommonPrivateKeyProvider } from '@web3auth/base-provider'

const chainConfig = {
  chainNamespace: CHAIN_NAMESPACES.SOLANA,
  chainId: '0x1', // Please use 0x1 for Mainnet, 0x2 for Testnet, 0x3 for Devnet
  rpcTarget: 'https://api.mainnet-beta.solana.com',
  displayName: 'Solana Mainnet',
  blockExplorer: 'https://explorer.solana.com',
  ticker: 'SOL',
  tickerName: 'Solana',
}
const privateKeyProvider = new CommonPrivateKeyProvider({ config: { chainConfig } })

const openloginAdapter = new OpenloginAdapter({
  privateKeyProvider,
})
web3authInstance.configureAdapter(openloginAdapter)

```
