> ## Documentation Index
> Fetch the complete documentation index at: https://launchdarkly.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Twilio Segment schema reference

<View title="Developer" />

<View title="Federal docs">
  > [!CAUTION]
  >
  > **This integration is not available in federal environments**
  >
  > To learn more, read [LaunchDarkly in federal environments](/docs/home/infrastructure/federal).
</View>

<View title="EU docs" />

This topic explains the different event kinds for Twilio Segment Data Export destinations. The JSON schemas for Twilio Segment are formatted differently than LaunchDarkly's. The `index`, `identify`, and `summary` event kinds are **not available** in Twilio Segment Data Export destinations, and other events are exported with different labels.

To learn more about the Twilio Segment destination, read [Twilio's Segment documentation](https://www.twilio.com/docs/segment).

There are four different event kinds exported to Twilio Segment. They are:

* [Feature events](#feature-events): This event is emitted when a feature flag is evaluated.
* [Click events](#click-events): This event is emitted when an end user clicks on a CSS selector for which they have configured a metric in an experiment.
* [Page view events](#page-view-events): This event is emitted when an end user loads a page associated with an experiment metrics.
* [Custom events](#custom-events): This event is emitted when LaunchDarkly SDK sends a `custom` event.

LaunchDarkly no longer supports `alias` events for SDKs upgraded to contexts. LaunchDarkly continues to support sending and receiving alias events for older SDK versions. For a list of SDKs that still support `alias` events, read [Aliasing users](/docs/sdk/features/aliasing-users).

## Additional properties

Twilio Segment events include additional information about different LaunchDarkly properties. These properties are included in all event kinds.

These properties are:

<table>
  <thead>
    <tr>
      <th>Property name</th>
      <th>Property details</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `event`
      </td>

      <td>
        The event kind. This field maps onto
        [Twilio Segment's event field](https://www.twilio.com/docs/segment/connections/spec/track).
      </td>
    </tr>

    <tr>
      <td>
        `environment`
      </td>

      <td>The LaunchDarkly environment ID, also called the client-side ID, corresponding to the event.</td>
    </tr>

    <tr>
      <td>
        `project`
      </td>

      <td>The LaunchDarkly project key corresponding to the event.</td>
    </tr>

    <tr>
      <td>
        `key`
      </td>

      <td>
        The flag key corresponding to the event. In the case of Experimentation events, this will be the metric key for the experiment.
      </td>
    </tr>

    <tr>
      <td>
        `userId`
      </td>

      <td>
        The key of the user object or user context kind associated with the emitted event. For example, in client-side SDKs, this is the key of the currently identified user. This field maps onto [Twilio Segment's userId field](https://www.twilio.com/docs/segment/connections/spec/track).
      </td>
    </tr>

    <tr>
      <td>
        `contextKeys`
      </td>

      <td>
        An object of `contextKind: contextKey` pairs for each context kind in the event.
      </td>
    </tr>
  </tbody>
</table>

## Feature events

This table explains `feature` event properties:

<table>
  <thead>
    <tr>
      <th>Property name</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `value`
      </td>

      <td>The value of the evaluated flag.</td>
    </tr>

    <tr>
      <td>
        `flagVersion`
      </td>

      <td>The version of the evaluated flag.</td>
    </tr>

    <tr>
      <td>
        `inExperiment`
      </td>

      <td>
        `true` if this flag evaluation was allocated to an experiment. \
        &#x20;To learn more, read Allocating experiment audiences]\(/home/experimentation/allocation).
      </td>
    </tr>

    <tr>
      <td>
        `reasonKind`
      </td>

      <td>
        The evaluation reason for the flag. \

        To learn more, read [Evaluation reasons](/docs/sdk/concepts/evaluation-reasons).
      </td>
    </tr>

    <tr>
      <td>
        `prereqOf`
      </td>

      <td>
        Set to another flag’s key if this flag evaluation was only performed in order to determine whether the prerequisite values were met for the indicated flag. \
        &#x20;To learn more, read [Flag prerequisites](/docs/home/flags/prereqs).
      </td>
    </tr>

    <tr>
      <td>
        `default`
      </td>

      <td>Indicates whether the flag value was the result of the default variation being evaluated.</td>
    </tr>

    <tr>
      <td>
        `variation`
      </td>

      <td>
        The variation of the flag requested. The SDK stores flag variation values in an array. This value corresponds to the index of the variation the array. Boolean flags show as `0` or `1` for `true` and `false`. For other flags, the array index starts at `0` for their different variations.
      </td>
    </tr>

    <tr>
      <td>
        `variationName`
      </td>

      <td>
        The evaluated variation's name, if it exists. If the evaluated variation doesn't have a name, this field doesn't appear.
      </td>
    </tr>
  </tbody>
</table>

## Click events

This table explains `click` event properties:

<table>
  <thead>
    <tr>
      <th>Property name</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `url`
      </td>

      <td>The URL from which a user context triggered a flag evaluation.</td>
    </tr>

    <tr>
      <td>
        `selector`
      </td>

      <td>
        The CSS selector corresponding to the `click` event.
      </td>
    </tr>
  </tbody>
</table>

## Page view events

This table explains `page view` event properties:

<table>
  <thead>
    <tr>
      <th>Property name</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `url`
      </td>

      <td>The URL from which a user context triggered a flag evaluation.</td>
    </tr>
  </tbody>
</table>

## Custom events

Custom events contain the properties listed under [Additional properties](#additional-properties).

This table explains `custom` event properties not listed in that section:

<table>
  <thead>
    <tr>
      <th>Property name</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `metricValue`
      </td>

      <td>
        The numeric value of a metric if it is specified in the event. If no metric value was provided, this field doesn't appear.
      </td>
    </tr>
  </tbody>
</table>
