Skip to content

Commit

Permalink
Improve documentation for proxy configuration and connection setup
Browse files Browse the repository at this point in the history
- Clarified the process of running the proxy container with the experimental feature `EXP_SERVER_SIDE_SDK_CONFIG_TOKENS`.
- Added instructions for replacing placeholders with actual values.
- Provided clear code examples for both running the proxy and connecting to it.
  • Loading branch information
beltagymohamed authored Jan 8, 2025
1 parent 3d36c6d commit b695fb1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,48 @@ print(variant)

For more information about variants, see the [Variant documentation](https://docs.getunleash.io/advanced/toggle_variants).


## Proxy Configuration

To connect to a proxy, you need to run the proxy container with the additional parameter `EXP_SERVER_SIDE_SDK_CONFIG_TOKENS`. **Note:** This is an experimental feature. For more details, refer to the [Unleash Proxy Documentation](https://docs.getunleash.io/reference/unleash-proxy#experimental-configuration-options).

### Step 1: Running the Proxy Container

Execute the following Docker command to run the proxy container with the necessary environment variables:

```bash
docker run \
-e UNLEASH_PROXY_CLIENT_KEYS=<proxy-client-key> \
-e UNLEASH_URL='<unleash-api-url>' \
-e UNLEASH_API_TOKEN=<client-api-token> \
-e EXP_SERVER_SIDE_SDK_CONFIG_TOKENS=<server-sdk-token> \
-p 3000:3000 \
unleashorg/unleash-proxy
```

Replace the following placeholders:
- `<proxy-client-key>`: Your proxy client key.
- `<unleash-api-url>`: The URL of your Unleash API.
- `<client-api-token>`: Your Unleash API token.
- `<server-sdk-token>`: The server SDK token (used for the experimental configuration).

### Step 2: Connecting to the Proxy

Once the proxy is running, you can connect to it by passing the server SDK token in the request header. Here's an example of how to set up the Unleash client:

```python
client = UnleashClient(
url='<unleash-api-url>',
app_name='<app-name>',
custom_headers={'Authorization': '<server-sdk-token>'},
)
```

Replace the following placeholders:
- `<unleash-api-url>`: The URL of your Unleash API.
- `<app-name>`: The name of your application.
- `<server-sdk-token>`: The server SDK token used to authenticate the request.

## Developing

For development, you'll need to setup the environment to run the tests. This repository is using
Expand Down

0 comments on commit b695fb1

Please sign in to comment.