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

# Create Instance

The [JavaScript SDK](https://www.npmjs.com/package/@peaq-network/sdk) supports EVM and Substrate transactions. In order to communicate and generate transactions using the peaq blockchain an instance must be created.

## createInstance(baseUrl, chainType, seed)

| Parameter     | Type        | EVM      | Substrate | Description                                                                                                                                                                                                           |
| ------------- | ----------- | -------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **baseUrl**   | `string`    | Required | Required  | RPC/WSS URL used to connect to the blockchain. Reference [Connecting to peaq](/peaqchain/build/getting-started/connecting-to-peaq) for supported URLs. Use **RPC** for EVM and **WSS** for Substrate (and EVM reads). |
| **chainType** | `ChainType` | Required | Optional  | Defines whether the instance will generate EVM or Substrate transactions (defaults to Substrate). Accessible via the SDK.                                                                                             |
| **seed**      | `string`    | N/A      | Optional  | Mnemonic phrase used in Substrate instances to execute write transactions on behalf of the user.                                                                                                                      |

<CodeGroup>
  ```javascript EVM theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  import { Sdk } from "@peaq-network/sdk";

  const HTTPS_BASE_URL = "https://quicknode.peaq.xyz";

  const sdk = await Sdk.createInstance({
      baseUrl: HTTPS_BASE_URL,
      chainType: Sdk.ChainType.EVM
  });

  // No direct API connection made to EVM so disconnect is unnecessary.
  ```

  ```javascript Substrate theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
  import { Sdk } from "@peaq-network/sdk";

  const WSS_BASE_URL = "wss://quicknode.peaq.xyz";
  const SUBSTRATE_SEED = process.env['SUBSTRATE_SEED'];

  const sdk = await Sdk.createInstance({
      baseUrl: WSS_BASE_URL,
      chainType: Sdk.ChainType.SUBSTRATE,
      seed: SUBSTRATE_SEED
  });

  // disconnect when finished
  await sdk.disconnect();
  ```
</CodeGroup>

Now you will have an **sdk** object that can be used to execute the [DID](/peaqchain/sdk-reference/javascript/did-operations), [RBAC](/peaqchain/sdk-reference/javascript/rbac-operations), and [Storage](/peaqchain/sdk-reference/javascript/storage-operations) operations on the peaq blockchain.

The EVM instance only constructs transactions objects, and does not send the transactions itself. This gives the user the ability to send peaq transactions
themselves without ever sending a private key through the sdk. However, if you would like this process abstracted away, we do provide a [Send Evm Transaction](/peaqchain/sdk-reference/javascript/send-evm-tx)
function. To mitigate concerns on how we use your seed/private key we have made our [peaq js](https://github.com/peaqnetwork/peaq-js) SDK fully open source.
