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

> [!note]
> This is a server-side function used for implementing [server-side tracking](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/server-side-tracking-with-the-engage-sdk-package.html "Server-side tracking with the Engage SDK package"). If you want to implement client-side tracking instead, use the [client-side functions](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/functions/sending-events-using-the-engage-sdk.html "Sending events using the Engage SDK").

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. |
| `req` | object | The HTTP request. |
| [`[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. |

Example 14. Next app

Here's an example of how to use the `identity()` function in a Next app.

```javascript
export async function middleware(req) {
  const res = NextResponse.next();

  // Load Engage API
  const engageSettings = {
    clientKey: "<client_key_PLACEHOLDER>",
    targetURL: "<stream_api_target_endpoint_PLACEHOLDER>",
    pointOfSale: "<point_of_sale_PLACEHOLDER>"
  };

  const engageServer = await initServer(engageSettings);

  // Send IDENTITY event
  const eventData = {
    channel: "WEB",
    currency: "EUR",
    identifiers: [
        {
            id: "123456",
            provider: "BXLP"
        }
    ]
  };

  const extensionData = {
    customKey: "customValue"
  };

  await engageServer.identity(eventData, req, extensionData);
  return res;
};

```