---
title: Configure the React Native SDK event dispatcher
slug: feature-experimentation/docs/configure-event-dispatcher-reactnative-prior-to-v4
docTags: 
createdAt: 2026-08-05T20:39:50.000Z
---

The Optimizely SDKs make HTTP requests for every [decision event or conversion event](docId\:SzVcfUMHk3IKycnEjgjbq) that gets triggered. The React Native SDK has a built-in **event dispatcher** for handling these events.

You can customize the event dispatcher you use in production to have more control over the way the SDK sends events so that it scales to the volumes handled by your application. Customizing the event dispatcher lets you handle large event volumes efficiently or to implement retry logic when a request fails. You can build your dispatcher from scratch or start with the provided dispatcher.

The following examples show how to initialize the Optimizely client (or manager) with an event dispatcher instance:

```javascript
import { createInstance, eventDispatcher } from '@optimizely/react-sdk';

// Create an Optimizely client with the default event dispatcher
// Note: If you don't pass eventDispatcher, this default event dispatcher
// will be used automatically. This is just to demonstrate how to provide
// an event dispatcher when creating an instance.
const optimizely = createInstance({
  datafile: optimizelyDatafile, // assuming you have a hardcoded datafile
  eventDispatcher: eventDispatcher,
});
```

The event dispatcher should implement a `dispatchEvent` function, which takes in three arguments:

- `httpVerb`
- `url`
- `params`

These arguments are created by the internal `EventBuilder` class. In this function, you should send a `POST` request to the given `url` using the `params` as the body of the request (be sure to stringify it to JSON) and `{content-type: 'application/json'}` in the headers.

:::hint{type="warning"}
**Important**
If you are using a custom event dispatcher, do not modify the event payload returned from Optimizely. Modifying this payload will alter your results.
:::

You can also persistent & queue events offline, then dispatch them when your React Native application regains Internet connectivity. For information, see [Event batching](docId\:L6LJsIHbEu9LfDd8Kt1fT).
