---
title: "Engage.identity(eventData[, extensionData])"
slug: "engage-identity"
abstract: "Describes the client-side identity() function in the Sitecore Engage SDK (Sitecore CDP Stream API)."
---
# Engage.identity(eventData\[, extensionData\])

The `identity()` function sends an IDENTITY event. The IDENTITY event is used to resolve the identity of an anonymous user of your app and turn them into a known user.

sidebar. Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| [`eventData`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/identity-event.html) | object | All the event data. |
| [`[extensionData]`](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/extension-data-object.html)<br><br>optional | object | Custom data about an event.<br><br>Maximum 50 custom attributes of your choice. |

Here's an example of how to use the `identity()` function to send the email address that a user enters in a form. In a React app, you can capture form data using the State Hook.

`components/Form.jsx`:

```javascript
import { useState } from "react";
import { engage } from "../engage";

export default function Form() {
    const [email, setEmail] = useState("");

    const handleEmail = (e) => {
        setEmail(e.target.value);
    };

    const handleSubmit = async (e) => {
        e.preventDefault();

        const eventData = {
          channel: "WEB",
          currency: "EUR",
          pointOfSale: "myretailsite/ireland",
          language: "EN",
          page: "home",
          email,
          identifiers: [
              {
                  id: "123456",
                  provider: "BXLP"
              }
          ]
        };

        const extensionData = {
          customKey: "customValue"
        };

        // Send IDENTITY event to Sitecore CDP
        await engage.identity(eventData, extensionData);
    };

    return (
        <form onSubmit={handleSubmit}>
            <label>
                <span>Email:</span>
                <input type="text" onChange={handleEmail} value={email} />
            </label>

            <button>Subscribe</button>
        </form>
    )
};

```