From 7955ac9266ec872278f8a16a08504a7f363a4b99 Mon Sep 17 00:00:00 2001 From: Mb Date: Thu, 9 Jan 2025 12:19:41 +0100 Subject: [PATCH 1/2] Add documentation for proxy configuration and connection setup - 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. --- docs/proxy.rst | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/proxy.rst diff --git a/docs/proxy.rst b/docs/proxy.rst new file mode 100644 index 00000000..a6c7329e --- /dev/null +++ b/docs/proxy.rst @@ -0,0 +1,45 @@ +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 `_. + +Step 1: Running the Proxy Container +------------------------------------ + +Execute the following Docker command to run the proxy container with the necessary environment variables: + +.. code-block:: bash + + docker run \ + -e UNLEASH_PROXY_CLIENT_KEYS= \ + -e UNLEASH_URL='' \ + -e UNLEASH_API_TOKEN= \ + -e EXP_SERVER_SIDE_SDK_CONFIG_TOKENS= \ + -p 3000:3000 \ + unleashorg/unleash-proxy + +Replace the following placeholders: + +- ````: Your proxy client key. +- ````: The URL of your Unleash API. +- ````: Your Unleash API 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: + +.. code-block:: python + + client = UnleashClient( + url='', + app_name='', + custom_headers={'Authorization': ''}, + ) + +Replace the following placeholders: + +- ````: The URL of your Unleash proxy, for example, ``http://localhost:3000/proxy``. +- ````: The name of your application. +- ````: The server SDK token used to authenticate the request. From ca38a84ad086c51b507306e79ab119cb1b7bd2d2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:23:11 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/proxy.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/proxy.rst b/docs/proxy.rst index a6c7329e..639f62b9 100644 --- a/docs/proxy.rst +++ b/docs/proxy.rst @@ -20,10 +20,10 @@ Execute the following Docker command to run the proxy container with the necessa Replace the following placeholders: -- ````: Your proxy client key. -- ````: The URL of your Unleash API. -- ````: Your Unleash API token. -- ````: The server SDK token (used for the experimental configuration). +- ````: Your proxy client key. +- ````: The URL of your Unleash API. +- ````: Your Unleash API token. +- ````: The server SDK token (used for the experimental configuration). Step 2: Connecting to the Proxy --------------------------------