# Installation And Deployment

{% hint style="info" %}
Note that with Streamr you can **deploy your data union via a frontend**. See [**build a Data Union with Streamr**](/getting-started/build-a-data-union-with-streamr.md) for more information.
{% endhint %}

### Installation

```
npm i @dataunions/client
```

### Client Setup

<pre class="language-typescript"><code class="lang-typescript"><strong>import { DataUnionClient } from '@dataunions/client'
</strong></code></pre>

1️⃣ **Add your private key** to the client. The address that deploys the contract will become the [admin](/main-concepts/roles-and-responsibilities/admin.md)  of the data union.&#x20;

2️⃣ **Choose a desired EVM chain** and add it to the <mark style="color:red;">`chain`</mark> parameter. We currently support Gnosis, Polygon and Ethereum.

ℹ️ When integrating this into your application a **wallet provider** should be added instead of an environment variable with a private key.

```typescript
const PRIVATE_KEY = process.env.PRIVATE_KEY;

const DU = new DataUnionClient({
  auth: {
    privateKey: PRIVATE_KEY,
  },
  chain: 'polygon',
});
```

### Configure Your Data Union

1️⃣ Add your desired deployment options. All of them are changeable after deployment by the admin/owner.

ℹ️ Read more about the different values here: [`owner`](/main-concepts/roles-and-responsibilities/admin.md), [`joinPartAgent`](/main-concepts/roles-and-responsibilities/joinpart-agents.md), [`adminFee`](/main-concepts/roles-and-responsibilities/admin.md), [`metadata`](/main-concepts/roles-and-responsibilities/admin.md)

```typescript
const deploymentOptions = {
    owner: YOUR_PUBLIC_KEY, // (default = deployer) Will be admin of the newly created data union
    joinPartAgents: /* By default set to owner and DUDAO address */, 
    adminFee: 0.3, // Must be between 0...1
    metadata: {
        "information": "related to your data union",
        "canBe": ["", "anything"]
    }
}
```

### Deploy The Data Union

**Save the contract address somewhere**, you'll need it later. If you lost it you can find it in your transaction history on the block explorer of the chain you deployed on. Simply search for your public address, all the transactions will come up.

```typescript
const dataUnion = await DU.deployDataUnion(
   deploymentOptions   
);

console.log("My data union contract address:", dataUnion.getAddress())
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dataunions.org/getting-started/build-a-data-union/installation-and-deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
