> For the complete documentation index, see [llms.txt](https://docs.mychips.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mychips.io/react-native/sdk-native/sdk-native-data-reference.md).

# SDK Native - Data Reference

Complete reference for the data objects available in the React Native campaigns SDK. The types and constants below are exported from `mychips-react-sdk.`

***

<figure><img src="https://1889388802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8FPXPNk0nLIRsJsg3nxP%2Fuploads%2FnPd3fgy2yXBjnd3W9T7C%2Fimage.png?alt=media&amp;token=e5f18b48-451a-462b-8cc2-2d35d3cd4159" alt=""><figcaption></figcaption></figure>

### MCCampaign

The main campaign object passed to `renderCampaign(campaign, index)` and `onCampaignsLoaded`.

| Field                     | Type                 | Description                                             |
| ------------------------- | -------------------- | ------------------------------------------------------- |
| `id`                      | `string`             | Unique campaign identifier.                             |
| `name`                    | `string`             | Campaign display name.                                  |
| `type`                    | `string`             | Campaign type. See MCCampaignType constants below.      |
| `creatives`               | `MCCreatives`        | Image URLs (see below).                                 |
| `links`                   | `MCLinks`            | Tracking and navigation URLs (see below).               |
| `totalConvertedValue`     | `number`             | Total reward in your virtual currency, including promo. |
| `remainingConvertedValue` | `number`             | Remaining reward the user can earn.                     |
| `promoRatio`              | `number`             | Promotional multiplier (1 = no promo, 2 = double).      |
| `progress`                | `MCProgress \| null` | User's progress; null if the user has not started.      |

### MCCreatives

Image assets for a campaign.

| Field       | Type             | Description                     |
| ----------- | ---------------- | ------------------------------- |
| `thumbnail` | `string \| null` | Small square preview image URL. |
| `cover`     | `string \| null` | Full-size banner image URL.     |

### MCLinks

Tracking and navigation URLs. `MCNativeAdView` handles impressions and default clicks automatically.

| Field              | Type             | Description                                                      |
| ------------------ | ---------------- | ---------------------------------------------------------------- |
| `trackingUrl`      | `string \| null` | Click tracking URL.                                              |
| `trackingPixelUrl` | `string \| null` | Impression pixel URL, fired automatically for visible campaigns. |
| `detailUrl`        | `string \| null` | Campaign detail page URL, opened on a default click.             |

### MCProgress

User progress on a campaign. campaign.progress is null when the user has not started it.

| Field             | Type     | Description                                              |
| ----------------- | -------- | -------------------------------------------------------- |
| `status`          | `string` | Progress status. See `MCCampaignStatus` constants below. |
| `eventsCompleted` | `number` | Number of events the user has completed.                 |
| `totalEvents`     | `number` | Total events required to complete the campaign.          |
| `valueEarned`     | `number` | Reward earned so far in your virtual currency.           |
| `progressValue`   | `number` | Completion percentage (0–100).                           |

### MCMeta

Response metadata returned alongside the campaign list.

| Field     | Type     | Description                   |
| --------- | -------- | ----------------------------- |
| `version` | `string` | API response format version.  |
| `count`   | `number` | Number of campaigns returned. |

> The exported MCCampaignResponse type contains campaigns: `MCCampaign[]` and `meta`: MCMeta. In the view callback, metadata is provided as the second argument: `onCampaignsLoaded={(campaigns, meta) => { ... }}` .

### MCCampaignType (constants)

Known campaign type values. Compare against `campaign.type`:

| Constant                       | Value            |
| ------------------------------ | ---------------- |
| `MCCampaignType.MULTI_REWARD`  | `"MultiReward"`  |
| `MCCampaignType.PLAY_TO_EARN`  | `"Play2Earn"`    |
| `MCCampaignType.SINGLE_REWARD` | `"SingleReward"` |

```typescript
import {MCCampaignType} from 'mychips-react-sdk';
import type {MCCampaign} from 'mychips-react-sdk';

function isMultiReward(campaign: MCCampaign): boolean {
  return campaign.type === MCCampaignType.MULTI_REWARD;
}
```

The type field is a string, not a closed enum. Your app should allow for new values.

### MCCampaignStatus (constants)

Known progress status values. Compare against `campaign.progress?.status`:

| Constant                     | Value         |
| ---------------------------- | ------------- |
| `MCCampaignStatus.CLICKED`   | `"clicked"`   |
| `MCCampaignStatus.STARTED`   | `"started"`   |
| `MCCampaignStatus.INSTALLED` | `"installed"` |
| `MCCampaignStatus.COMPLETED` | `"completed"` |
| `MCCampaignStatus.EXPIRED`   | `"expired"`   |
| `MCCampaignStatus.CLOSED`    | `"closed"`    |

```typescript
import {MCCampaignStatus} from 'mychips-react-sdk';
import type {MCCampaign} from 'mychips-react-sdk';

function isCompleted(campaign: MCCampaign): boolean {
  return campaign.progress?.status === MCCampaignStatus.COMPLETED;
}
```

The status field is a string, not a closed enum. Your app should allow for new values.

### Image Loading

For a custom React Native card, use React Native's Image component with a campaign image URL:

```typescript
import React from 'react';
import {Image, View} from 'react-native';
import type {MCCampaign} from 'mychips-react-sdk';

export function CampaignCover({campaign}: {campaign: MCCampaign}) {
  const url = campaign.creatives.cover || campaign.creatives.thumbnail;

  return url ? (
    <Image
      source={{uri: url}}
      resizeMode="cover"
      style={{width: '100%', height: 172}}
    />
  ) : (
    <View style={{width: '100%', height: 172,
      backgroundColor: '#E8E8E8'}} />
  );
```

React Native loads the remote image and updates it when the source changes. You can use your own image library if preferred. For a small square card, choose thumbnail first; for a wide card, choose cover first. Animated GIF playback on Android depends on the host app's image support and is separate from these data types.

### External References

For additional template examples and field mappings, see the [Figma Showcase](https://www.figma.com/board/7ctPofi9irp7PV4TwT3a7l/MyChips-SDK-Default-Layouts?node-id=0-1).<br>
