# Member

{% hint style="info" %}
A data union **can scale to thousands or even millions of data-producing members**.&#x20;

Members are the **people and/or devices** that **produce and share data.**

After joining, they start **receiving a share of the revenue that accumulates in the data union contract**.
{% endhint %}

### Member Stats

Get useful information about a specific member address:

```typescript
const memberStats = await dataUnion.getMemberStats('0x1234');
```

<pre class="language-typescript"><code class="lang-typescript">// returns:
{
<strong>    earningsBeforeLastJoin: BigNumber {_hex: '0x00', _isBigNumber: true},
</strong><strong>    status: "ACTIVE",
</strong>    totalEarnings: BigNumber {_hex: '0x00', _isBigNumber: true},
    withdrawableEarnings: BigNumber {_hex: '0x00', _isBigNumber: true}
}
</code></pre>

Check if member is part of the data union:

```typescript
await dataUnion.isMember();
```

### Inactive And Active Members

The data union smart contract **does not delete members** when they leave or get removed from the data union. Instead they are set as <mark style="color:red;">`inactive`</mark>. This prevents them from earning more tokens. When they (re)join the data union they get set as <mark style="color:red;">`active`</mark>. That way **members that got removed or left are still able to withdraw their earnings** from the contract.

### Member Joins

Members **cannot join** your data union **without the help of a**[ **joinPart agent**](joinpart-agents) - The smart contract prevents that.

To **automate member joins**, read more here:

{% content-ref url="../join-server" %}
[join-server](../join-server)
{% endcontent-ref %}

### Member Parts/Leaves

Every member is able to leave the data union at any time:

```typescript
const tx = await dataUnion.part();
```
