# getUserStats(\[payload,])

```typescript
const campaignId = 'aSlug123';

const stats = await userClient.getUserStats(
   {
      campaign: {
         id: campaignId
      }
   }
)
```

## Params

<table><thead><tr><th width="180">Param</th><th width="106">Required</th><th width="96">Type</th><th>Description</th></tr></thead><tbody><tr><td>campaign.id</td><td>required</td><td>String</td><td><p>the id of the program/campaign the requirement belongs to.</p><p><br>Note: this campaign/program must belong to your account.</p></td></tr></tbody></table>

## **Response**

***UserStatsResponse***

<table><thead><tr><th width="180">Field</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>links_clicked.total</td><td>number</td><td>Total links clicked for the user and campaign</td></tr><tr><td>rewards_earnings.unclaimed_earnings_sum</td><td>string</td><td>Total unclaimed earnings amount formatted to two decimal points.</td></tr><tr><td>rewards_earnings.display_amount</td><td>string</td><td>Total unclaimed earnings amount formatted to two decimal points with the currency</td></tr></tbody></table>

## Examples

{% tabs %}
{% tab title="Browser" %}

```typescript
import { ChainvineClient } from '@chainvine/sdk';

const userWalletAddress = '0x293kdo0ij0';
const campaignId = 'aSlug123';

const client = new ChainvineClient(); //Make sure to whitelist your domain
const userClient = await client.syncUser(userWalletAddress);

const stats = await userClient.getUserStats({
    campaign: {
        id: campaignId
    },
});
```

{% endtab %}

{% tab title="Server" %}

```typescript
import { ChainvineClient } from '@chainvine/sdk';

const userWalletAddress = '0x293kdo0ij0';
const campaignId = 'aSlug123';

// Generate your ChainvineClient instance
const client = new ChainvineClient({
    apiKey: '0dj03j000d'  // Your API Key
});

const userClient = await client.syncUser(userWalletAddress);

const stats = await userClient.getUserStats({
    campaign: {
        id: campaignId
    },
});
```

{% endtab %}
{% endtabs %}
