---
title: Implement Real-Time Audiences for Feature Experimentation for server-side SDKs
slug: feature-experimentation/docs/real-time-audiences-for-feature-experimentation-for-server-side-sdks
docTags: 
createdAt: 2026-08-05T20:39:54.000Z
---

After creating an audience with [Real-Time Audiences for Feature Experimentation](docId:6UBBxxRv331nBIVZ2lun8) and assigning it to a [flag rule](docId:-yq2-thNRv7-SgwCXpG90), you can integrate the audience in your server-side code.

If you are not familiar with targeted deliveries and experiments in Feature Experimentation, it is recommended you follow the [Quickstart](docId\:GqD16Oyh9sH37TwarqEHo) guide for your specific SDK first before following this document.

## Install and initialize the server-side SDK

:::hint{type="warning"}
**Important**
You may need to upgrade your SDK to the latest version to use Real-Time Audiences for Feature Experimentation. Refer to the [SDK compatibility matrix](docId:2shbZfPCkPAZ0mlZpL1TU) to view the newest version available for your SDK.
:::

The first step is to install and initialize the Feature Experimentation SDK in your application. When initializing the SDK, you must enable the Optimizely Data Platform (ODP) audiences and the `ODPManager`. See the [Customize configuration](docId\:KjzMgmj-6wFmsgDC1wq5B) section for information on `ODPManager` customization options.

Refer to the following documentation for your SDK:

**C#**

- [Install](docId\:t4HfKZrY-A5Uc37TFEJeu)
- [Initialize](docId\:xoqfGXRS2U3DUf8EUgtsC)

**Java**

- [Install](docId\:j_tR91lKtVw5WCfcMOmtE)
- [Initialize](docId\:WlItbLTrjYBNvKSjoGIFY)

**JavaScript**  – SDK versions 6.0.0 and later.

- [Install](docId:3JawOqz5fbBQd8osjSukT)
- [Initialize](docId:2bQ4KAFcVOAesqDOcmtCZ)

**JavaScript (Node)** – SDK versions 5.3.5 and earlier.

- [Install SDK](docId\:aWlYGdCB88CMVFXhGcI2o)
- [Initialize SDK](docId\:bBBQu0Y_QWNguXJJ6sRw4)

**Go**

- [Install](docId\:EjET65QSc3PLAf2male2Q)
- [Initialize](docId\:lA6eDbcuVC3C-SQUsCcXV)

**Python**

- [Install](docId\:YJuAv_l6YdHgu2Boes3aO)
- [Initialize](docId:3RNo0adSzdB2ndnj5I_WC)

**Ruby**

- [Install](docId\:REGGc3P4WPkJW2XWh1dEr)
- [Initialize](docId\:GZzK3CQxBF2g4uWupfu70)

[Optimizely Agent](docId\:FBkIiB4shao_1U30W5cAu)

## Real-Time Audiences for Feature Experimentation using`OptimizelyUserContext`

:::hint{type="info"}
**Note**
`OptimizelyUserContext` can only be created after the SDK instance is ready (the datafile has been fetched).
:::

After you have installed and initialized the Optimizely client, you need to create an `OptimizelyUserContext` object with your Feature Experimentation userID and additional attributes. The `OptimizelyUserContext` object lets you make flag decisions and track events for a user context that you have already created using the `createUserContext` method.

:::hint{type="info"}
**Note**
When an `OptimizelyUserContext` is created, the SDK automatically sends an identify request to ODP.
:::

Call `fetchQualifiedSegments()` and then `isQualifiedFor()` on the `OptimizelyUserContext` object to first fetch the ODP audiences for the specific userID or any time you need to check if the user context is qualified for a given ODP real-time audience. Refer to your chosen SDK's documentation on `OptimizelyUserContext` for details and code samples:

- [C#](docId\:UZTTnJ2LeXwXXWe_aZvjr)
- [Go](docId\:YD23vbbeambJxxmSEXUo8)
- [Java](docId\:gm_UYsgiYClOVsYuAnlBX)
- [JavaScript](docId\:OExtupzmm3AyVp8uWgIoC) – SDK versions 6.0.0 and later.
- [Javascript (Node)](docId\:jEgEOt1Ywg2IFdWasBps7) – SDK versions 5.3.5 and earlier.
- [Python](docId\:UGnzh86pPS0MtU91FSSlQ)
- [Ruby](docId\:CBB2m_VFyZWW2HqXI529Q)

## Make experiment decisions

You can use the standard [Decide methods](docId\:Mq8a-0tyTzM32HEt362lj) enriched with [Real-Time Audiences for Feature Experimentation](docId:6UBBxxRv331nBIVZ2lun8) to return flag decisions for a user. The flag decision includes the status if the flag is enabled or disabled and the flag variation. When an ODP-type audience condition is required for the decision, the SDK can look up the ODP audiences in the current user context saved when `fetchQualifiedSegments()` is called. Refer to your specific SDK's documentation on calling these methods:

**C#**

- [Decide methods](docId\:QB-OuF0F-Tj3XpdYgXX1L)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:zhH9VEzcuw2gE1icY6hTU)

**Go**

- [Decide methods](docId\:BlCsg45md_3l5fQuAUQwO)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:jaSIo7LcJFLve2dx5desa)

**Java**

- [Decide methods](docId:6ZSh7uRg7JxlrHwft2Ogf)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:IhvMH_mWOLV_XGYpw-l8b)

**JavaScript** – SDK versions 6.0.0 and later.

- [Decide methods](docId\:SlmvozhQJ1rmI6AIIoqql)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:n2SxUgEcMIpHfqJk6Hg0Y)

**JavaScript (Node)** – SDK versions 5.3.5 and earlier.

- [Decide methods](docId\:OR0QUdFTq9bg4lGgOz-nH)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:acfLOrw1v-6HN-6C22eFj)

**Python**

- [Decide methods](docId\:i0YJZkiaylg7J6QKk3GR_)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId\:lnxTRZc6OudZqOWF2jLSc)

**Ruby**

- [Decide methods](docId\:W-MCwQUNp-EC5yaDomerg)
- [Real-Time Audiences for Feature Experimentation segment qualification methods](docId:0XHlYTIKhKO-FHN6fCDL7)

**Optimizely Agent**

- [Fetch qualified segments](docId\:uhGRMsjV6oSlDxKZO_kn5)

## Send events to Optimizely Data Platform

You can call `sendOdpEvent()` on the `OptimizelyClient` to send arbitrary event data to ODP. Refer to your preferred SDK to learn more:

- [C#](docId\:xLprVQpcTKoqnlAVi-kI5)
- [Go](docId\:MnF57itYgUbrjRd94dWBk)
- [Java](docId\:T20aG6YXizVcReWi4Z-Z8)
- [JavaScript](docId\:d2I10chLM1yXhaUzeMUS-) – SDK versions 6.0.0 and later.
- [JavaScript (Node)](docId\:BPq_C7t_Af98i9P6XKJgb) – SDK versions 5.3.5 and earlier.
- [Python](docId\:klN0th0aHuZNe0VlFqpKA)
- [Ruby](docId\:Mei0PjzgwMObpXP2Rn4x3)
- [Optimizely Agent](docId\:uhGRMsjV6oSlDxKZO_kn5)

## Customize configuration

You must implement the `ODPManager` parameter when you initialize the SDK for the Real-Time Audiences integration to work. You can customize the `ODPManager` or override the entire `ODPManager` with a custom one. Each Feature Experimentation SDK implements its own way of supporting it. Refer to your desired SDK to learn more.

- [C#](docId\:xoqfGXRS2U3DUf8EUgtsC)
- [Go](docId\:lA6eDbcuVC3C-SQUsCcXV)
- [Java](docId\:WlItbLTrjYBNvKSjoGIFY)
- [JavaScript](docId:2bQ4KAFcVOAesqDOcmtCZ) – SDK versions 6.0.0 and later.
- [JavaScript (Node)](docId\:bBBQu0Y_QWNguXJJ6sRw4) – SDK versions 5.3.5 and earlier.
- [Python](docId:3RNo0adSzdB2ndnj5I_WC)
- [Ruby](docId\:GZzK3CQxBF2g4uWupfu70)
- [Optimizely Agent](docId:2ulb_rxGbxPeOEgVARD_m)
