***

title: userEvent
slug: /reference/typescript/relay/call/user-event
description: Send a custom user-defined event on a call.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Send a custom user-defined event on the call. User events allow you to pass
application-specific data through the RELAY event system. Other listeners on
the same call can receive and react to these events.

## **Parameters**

<ParamField path="event" type="string | undefined" toc={true}>
  The event name or identifier.
</ParamField>

The `options` type also accepts additional keys (`& Record<string, unknown>`), but
only the `event` field is extracted and sent in the RPC call.

## **Returns**

`Promise<Record<string, unknown>>` -- Server response confirming the event was sent.

## **Example**

```typescript {13}
import { RelayClient } from '@signalwire/sdk';

const client = new RelayClient({
  project: process.env.SIGNALWIRE_PROJECT_ID!,
  token: process.env.SIGNALWIRE_TOKEN!,
  contexts: ['default']
});

client.onCall(async (call) => {
  await call.answer();

  // Send a custom event
  const result = await call.userEvent({
    event: 'customer_identified',
  });
  console.log(`User event sent: ${JSON.stringify(result)}`);
});

await client.run();
```