---
source_url: https://www.pubnub.com/docs/chat/components/react-native/data-payloads
title: Data payloads for PubNub Chat Components for React Native
updated_at: 2026-06-18T11:25:23.167Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Data payloads for PubNub Chat Components for React Native

:::warning Migrate to Chat SDK
PubNub will stop supporting Chat Components on January 1, 2025 but you are [welcome to contribute](https://github.com/pubnub/react-chat-components). Learn how to migrate to the Chat SDK [here](https://www.pubnub.com/docs/general/resources/migration-guides/react-components-chat-sdk).
:::

PubNub Chat Components for React Native enforce you to use the unified JSON schemas (data models) for such common entity types as [users](#users), [channels](#channels), and [messages](#messages) when transferring data over the PubNub network. These common data payloads allow you to create cross-platform applications and ensure that such applications developed in different technologies (Swift, Kotlin, or JavaScript) communicate with one another properly, avoiding any unexpected errors.

:::tip Data payload validation
To avoid any parsing errors, validate the data payload you prepared for users, channels, and messages in an [online validator](https://www.jsonschemavalidator.net).
:::

## Users

Follow this schema for the user data in your apps:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "User",
  "description": "User of a chat application",
  "properties": {
    "id": {
      "description": "Unique identifier for a user",
      "type": "string"
    },
    "name": {
      "description": "Name of the user that you can display in the UI",
      "type": "string"
    },
    "email": {
      "description": "User's email address",
      "type": "string"
    },
    "externalId": {
      "description": "Reference to user identifier from another, external system",
      "type": "string"
    },
    "profileUrl": {
      "description": "URL to a user avatar that you can display in the UI",
      "type": "string"
    },
    "custom": {
      "description": "Any additional payload information",
      "type": "object",
      "properties": {
        "description": {
          "description": "Description, job title, or some other information that you can display in the UI",
          "type": "string"
        }
      }
    },
    "eTag": {
      "description": "Identifier used for cache invalidation",
      "type": "string"
    },
    "updated": {
      "description": "ISO8601 date string of when the user has been last updated",
      "type": "string"
    }
  },
  "required": ["id"]
}
```

Example:

```json
{
  "id": "some-user-id",
  "name": "Jane Doe",
  "email": "jane.doe@example.com",
  "externalId": "some-external-user-id",
  "profileUrl": "https://randomuser.me/api/portraits/men/1.jpg",
  "custom": {
    "description": "Office Assistant"
  },
  "eTag": "AYGyoY3gre71eA",
  "updated": "2020-09-23T09:23:34.598494Z"
}
```

## Channels

Follow this schema for the channel data in your apps:

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Channel",
  "description": "Channel in the chat application",
  "properties": {
    "id": {
      "description": "Unique identifier for a channel",
      "type": "string"
    },
    "name": {
      "description": "Name of the channel that you can display in the UI",
      "type": "string"
    },
    "description": {
      "description": "Description of the channel that you can display in the UI",
      "type": "string"
    },
    "custom": {
      "description": "Any additional payload information",
      "type": "object",
      "properties": {
        "profileUrl": {
          "description": "URL to a channel avatar that you can display in the UI",
          "type": "string"
        }
      }
    },
    "eTag": {
      "description": "Identifier used for cache invalidation",
      "type": "string"
    },
    "updated": {
      "description": "ISO8601 date string of when the user has been last updated",
      "type": "string"
    }
  },
  "required": ["id", "type"]
}
```

Example:

```json
{
  "id": "some-channel-id",
  "name": "Off-topic",
  "description": "Off-topic channel for random chatter and fun",
  "custom": {
    "profileUrl": "https://www.gravatar.com/avatar/149e60f311749f2a7c6515f7b34?s=256&d=identicon"
  },
  "eTag": "AbOx6N+6vu3zoAE",
  "updated": "2020-09-23T09:23:37.175764Z"
}
```

## Messages

Follow this schema for the message data in your apps:

:::note Supported data types
PubNub Chat Components for React Native support only text message data types.
:::

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Message Content",
  "description": "Message content in the chat application",
  "type": "object",
  "properties": {
    "id": {
      "description": "Unique identifier for a message. Use the UUID v4 algorithm.",
      "type": "string"
    },
    "text": {
      "description": "Text of the message that you can display in the UI",
      "type": "string"
    },
    "contentType": {
      "description": "If a message contains any extra content, this field describes its type. Currently, PubNub Chat Components support only text messages.",
      "type": "string",
      "examples": ["externalUrl", "imageUrl"]
    },
    "content": {
      "description": "Extra content for the message. It can contain any feature-specific data like URLs to external images.",
      "type": "object"
    },
    "createdAt": {
      "description": "ISO8601 date string of when the message was created",
      "type": "string"
    },
    "custom": {
      "description": "Any additional payload information",
      "type": "object"
    }
  },
  "required": ["id", "text", "createdAt"]
}
```

Example:

```json
{
  "id": "6da72b98-e211-4724-aad4-e0fb9f08999f",
  "text": "Let's sync on the topic in this thread.",
  "contentType": "none",
  "content": {},
  "custom": {},
  "createdAt": "2022-05-10T14:48:00.000Z"
}
```