Skip to main content

We have integrated the Experiment SDK (JavaScript) into our React application and are currently utilizing both the experiment and feature-flag functionalities.

To fetch flags data, we initialize the SDK as follows:

```javascript
this.experiment = Experiment.initializeWithAmplitudeAnalytics(apiKey);
await this.experiment.start();
```

Then, we retrieve the data using this.experiment.variant(variantKey).

However, we are encountering an issue where the flags data is blocked by ad blockers or in certain regions, preventing us from accessing the data. To resolve this, we attempted to use a reverse proxy URL like below:

```javascript
Experiment.initializeWithAmplitudeAnalytics(apiKey, { flagServerUrl: "proxy-url" });
```

Unfortunately, the SDK automatically appends `sdk/v2/flags` to each request, which makes it difficult to bypass the blockage.

 

Ultimately, we are trying to achieve a setup similar to how we apply a reverse proxy to Amplitude event requests, where we can set a reverse proxy URL for flags data retrieval through the SDK. We would like to ask if there is any way to configure the SDK to fetch flags data through a reverse proxy URL.

 

Does anyone know about how to do this?

Be the first to reply!

Reply