From 8edf584581172b9f606d600c43c5537613852a57 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 09:33:41 -0600 Subject: [PATCH 01/39] update js-sdk to use updated variables --- .../javascript-sdk/client-server/README.md | 30 ++++++++++--- .../javascript-sdk/client-server/server.js | 44 ++++++++++++++++--- .../client-server/views/error.html | 4 +- .../client-server/views/index.html | 32 +++++++------- .../client-server/views/intro.html | 14 +++--- .../client-server/views/login.html | 16 ++++--- .../javascript-sdk/client-side/README.md | 30 +++++++++---- .../javascript-sdk/client-side/entrypoint.sh | 6 +++ .../client-side/html/iframe.html | 2 +- .../client-side/html/index.html | 12 ++--- 10 files changed, 131 insertions(+), 59 deletions(-) diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 00dc535e..431edf29 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -1,8 +1,11 @@ -# Client-Server UID2 Integration Example using JavaScript SDK +# Client-Server UID2/EUID Integration Example using JavaScript SDK -[This example](https://example-jssdk-integ.uidapi.com/) demonstrates how a content publisher can use the [UID2 services](https://unifiedid.com/docs/intro) and the [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript) to implement the [client-server UID2 integration workflow](https://unifiedid.com/docs/guides/integration-javascript-client-server). +[This example](https://example-jssdk-integ.uidapi.com/) demonstrates how a content publisher can use the UID2/EUID services and the UID2/EUID SDK for JavaScript to implement the client-server UID2/EUID integration workflow. -For an example application without using the UID2 SDK, see [Server-Side UID2 Integration Example](../../server-side/README.md). +- For UID2: [UID2 services](https://unifiedid.com/docs/intro), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), [client-server UID2 integration workflow](https://unifiedid.com/docs/guides/integration-javascript-client-server) +- For EUID: [EUID services](https://euid.eu/docs/intro), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript), [client-server EUID integration workflow](https://euid.eu/docs/guides/integration-javascript-client-server) + +For an example application without using the SDK, see [Server-Side UID2 Integration Example](../../server-side/README.md). > NOTE: While the server side of the example application is implemented in JavaScript using node.js, it is not > a requirement. You can use any technology of your choice and refer to the example application for illustration of the functionality that needs to be implemented. @@ -29,11 +32,22 @@ docker run -it --rm -p 3000:3000 -e "UID2_BASE_URL=https://operator-integ.uidapi The following table lists the environment variables that you must specify to start the application. +### Core Configuration + +| Parameter | Data Type | Description | +| :------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `UID2_BASE_URL` | string | The base URL of the UID2/EUID service. Examples:
UID2 Testing: `https://operator-integ.uidapi.com`
EUID Testing: `https://integ.euid.eu/v2`
For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | +| `UID2_API_KEY` | string | Your UID2/EUID authentication key for the service specified in `UID2_BASE_URL`. | +| `UID2_CLIENT_SECRET` | string | Your UID2/EUID client secret for the service specified in `UID2_BASE_URL`. | +| `UID2_JS_SDK_URL` | string | URL to the JavaScript SDK. Examples:
UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | +| `UID2_JS_SDK_NAME` | string | Global variable name for the SDK. UID2: `__uid2`, EUID: `__euid` | + +### Display/UI Configuration + | Parameter | Data Type | Description | | :------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `UID2_BASE_URL` | string | The base URL of the UID2 service. For example:
Testing environment: `https://operator-integ.uidapi.com`
For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments). | -| `UID2_API_KEY` | string | Your UID2 authentication key for the UID2 service specified in `UID2_BASE_URL`. | -| `UID2_CLIENT_SECRET` | string | Your UID2 client secret for the UID2 service specified in `UID2_BASE_URL`. | +| `PRODUCT_NAME` | string | Product name for UI display (default: `UID2`, or `EUID`) | +| `DOCS_BASE_URL` | string | Documentation base URL (default: `https://unifiedid.com/docs`, or `https://euid.eu/docs`) | After you see output similar to the following, the example application is up and running. @@ -48,7 +62,9 @@ If needed, to close the application, terminate the docker container or use the ` ## Test the Example Application -The example application illustrates the steps documented in the [UID2 SDK Integration Guide](https://unifiedid.com/docs/guides/publisher-client-side). For an overview of the high-level workflow for establishing UID2 identity, API reference, and explanation of the UID2 cookie format, see [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/client-side-identity). +The example application illustrates the steps documented in the integration guides. For an overview of the high-level workflow for establishing UID2/EUID identity, API reference, and cookie format details, see: +- UID2: [UID2 SDK Integration Guide](https://unifiedid.com/docs/guides/publisher-client-side), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/client-side-identity) +- EUID: [EUID SDK Integration Guide](https://euid.eu/docs/guides/publisher-client-side), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/client-side-identity) The following table outlines and annotates the steps you may take to test and explore the example application. diff --git a/web-integrations/javascript-sdk/client-server/server.js b/web-integrations/javascript-sdk/client-server/server.js index 55485971..781918d8 100644 --- a/web-integrations/javascript-sdk/client-server/server.js +++ b/web-integrations/javascript-sdk/client-server/server.js @@ -13,6 +13,12 @@ const uid2BaseUrl = process.env.UID2_BASE_URL; const uid2ApiKey = process.env.UID2_API_KEY; const uid2ClientSecret = process.env.UID2_CLIENT_SECRET; +// UI/Display configuration +const productName = process.env.PRODUCT_NAME || 'UID2'; +const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; +const uid2JsSdkUrl = process.env.UID2_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; +const uid2JsSdkName = process.env.UID2_JS_SDK_NAME || '__uid2'; + const ivLength = 12; const nonceLength = 8; const timestampLength = 8; @@ -25,7 +31,13 @@ app.engine('.html', ejs.__express); app.set('view engine', 'html'); app.get('/', (req, res) => { - res.render('index', { uid2BaseUrl: uid2BaseUrl }); + res.render('index', { + uid2BaseUrl: uid2BaseUrl, + productName: productName, + docsBaseUrl: docsBaseUrl, + uid2JsSdkUrl: uid2JsSdkUrl, + uid2JsSdkName: uid2JsSdkName + }); }); function bufferToBase64(arrayBuffer) { @@ -106,14 +118,36 @@ app.post('/login', async (req, res) => { const response = decrypt(encryptedResponse.data, uid2ClientSecret, nonce); if (response.status !== 'success') { - res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response }); + res.render('error', { + error: 'Got unexpected token generate status in decrypted response: ' + response.status, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else if (typeof response.body !== 'object') { - res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response }); + res.render('error', { + error: 'Unexpected token generate response format in decrypted response: ' + response, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else { - res.render('login', { identity: response.body, uid2BaseUrl: uid2BaseUrl }); + res.render('login', { + identity: response.body, + uid2BaseUrl: uid2BaseUrl, + productName: productName, + docsBaseUrl: docsBaseUrl, + uid2JsSdkUrl: uid2JsSdkUrl, + uid2JsSdkName: uid2JsSdkName + }); } } catch (error) { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); diff --git a/web-integrations/javascript-sdk/client-server/views/error.html b/web-integrations/javascript-sdk/client-server/views/error.html index 5e216e61..098bd957 100644 --- a/web-integrations/javascript-sdk/client-server/views/error.html +++ b/web-integrations/javascript-sdk/client-server/views/error.html @@ -2,7 +2,7 @@ - Error - Client-Server UID2 Integration Example using JavaScript SDK + Error - Client-Server <%- productName %> Integration Example using JavaScript SDK @@ -10,7 +10,7 @@ <%- include('intro.html'); -%>

Something went wrong:

<%= error %>
-

Response from the UID2 operator:

+

Response from the <%- productName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/javascript-sdk/client-server/views/index.html b/web-integrations/javascript-sdk/client-server/views/index.html index d4b9b34c..e3154924 100644 --- a/web-integrations/javascript-sdk/client-server/views/index.html +++ b/web-integrations/javascript-sdk/client-server/views/index.html @@ -2,23 +2,25 @@ - Client-Server UID2 Integration Example using JavaScript SDK + Client-Server <%- productName %> Integration Example using JavaScript SDK - + @@ -60,19 +62,19 @@

       
       
-        UID2 Advertising Token:
+        <%- productName %> Advertising Token:
         

       
       
-        Is UID2 Login Required?
+        Is <%- productName %> Login Required?
         

       
       
-        UID2 Identity Updated Counter:
+        <%- productName %> Identity Updated Counter:
         

       
       
-        UID2 Identity Callback State:
+        <%- productName %> Identity Callback State:
         

       
     
@@ -87,12 +89,12 @@
             style="border-style: none"
           />
         
-        
+
diff --git a/web-integrations/javascript-sdk/client-server/views/intro.html b/web-integrations/javascript-sdk/client-server/views/intro.html index 989db663..bbb88016 100644 --- a/web-integrations/javascript-sdk/client-server/views/intro.html +++ b/web-integrations/javascript-sdk/client-server/views/intro.html @@ -1,12 +1,12 @@ -

Client-Server UID2 Integration Example using JavaScript SDK

+

Client-Server <%- productName %> Integration Example using JavaScript SDK

- This example demonstrates how a content publisher can use the UID2 services and the - UID2 SDK for JavaScript services and the + <%- productName %> SDK for JavaScript - (UID2 SDK) to implement the - client-server UID2 integration workflow SDK) to implement the + client-server <%- productName %> integration workflow. [Source Code] diff --git a/web-integrations/javascript-sdk/client-server/views/login.html b/web-integrations/javascript-sdk/client-server/views/login.html index c3dc3cac..534b9e2c 100644 --- a/web-integrations/javascript-sdk/client-server/views/login.html +++ b/web-integrations/javascript-sdk/client-server/views/login.html @@ -2,30 +2,32 @@ - Login - Client-Server UID2 Integration Example using JavaScript SDK + Login - Client-Server <%- productName %> Integration Example using JavaScript SDK - + <%- include('intro.html'); -%> -

Generate UID2 completed

-

UID2 identity:

+

Generate <%- productName %> completed

+

<%- productName %> identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

- Normally user would be redirected automatically, but this example demonstrates one way UID2 + Normally user would be redirected automatically, but this example demonstrates one way <%- productName %> generation could be handled.

diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index dc6c211f..115aab83 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -1,6 +1,6 @@ -# Client-Side UID2 Integration Example using JavaScript SDK +# Client-Side UID2/EUID Integration Example using JavaScript SDK -This example demonstrates how a content publisher can follow the [Client-Side Integration Guide for JavaScript](https://unifiedid.com/docs/guides/integration-javascript-client-side) to implement UID2 integration and generate UID2 tokens. +This example demonstrates how a content publisher can follow the [Client-Side Integration Guide for JavaScript](https://unifiedid.com/docs/guides/integration-javascript-client-side) (UID2) or [EUID Client-Side Integration Guide for JavaScript](https://euid.eu/docs/guides/integration-javascript-client-side) (EUID) to implement UID2/EUID integration and generate UID2/EUID tokens. ## Running with Docker @@ -35,11 +35,22 @@ docker run -p 3032:3032 --env-file .env javascript-sdk-client-side The application uses environment variables from the `.env` file in the base directory: -- `UID_JS_SDK_URL` - URL to the UID2 JavaScript SDK (default: https://cdn.uidapi.com/sdk/uid2-sdk-3.3.0.js) -- `UID_JS_SDK_NAME` - Global variable name for the SDK (default: __uid2) -- `UID_BASE_URL` - UID2 base URL (default: https://operator-integ.uidapi.com) -- `SERVER_PUBLIC_KEY` - Server public key for UID2 -- `SUBSCRIPTION_ID` - UID2 subscription ID +### Core Configuration +- `UID2_JS_SDK_URL` - URL to the UID2/EUID JavaScript SDK + - UID2 default: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js` + - EUID example: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` +- `UID2_JS_SDK_NAME` - Global variable name for the SDK + - UID2: `__uid2` + - EUID: `__euid` +- `UID2_BASE_URL` - API base URL + - UID2 default: `https://operator-integ.uidapi.com` + - EUID example: `https://integ.euid.eu/v2` +- `UID2_CSTG_SERVER_PUBLIC_KEY` - Server public key for client-side token generation +- `UID2_CSTG_SUBSCRIPTION_ID` - Subscription ID for client-side token generation + +### Display/UI Configuration +- `PRODUCT_NAME` - Product name for UI display (default: `UID2`, or `EUID`) +- `DOCS_BASE_URL` - Documentation base URL (default: `https://unifiedid.com/docs`, or `https://euid.eu/docs`) ## Accessing the Application @@ -47,8 +58,9 @@ Once running, access the application at: http://localhost:3032 ## Features -- **Client-side UID2 integration** using the UID2 JavaScript SDK -- **Environment variable substitution** for configuration +- **Client-side UID2/EUID integration** using the UID2/EUID JavaScript SDK +- **Dynamic product configuration** - supports both UID2 and EUID via environment variables +- **Environment variable substitution** for all configuration and UI text - **Nginx-based static file serving** - **Docker containerization** for easy deployment diff --git a/web-integrations/javascript-sdk/client-side/entrypoint.sh b/web-integrations/javascript-sdk/client-side/entrypoint.sh index ac366bd2..15958059 100644 --- a/web-integrations/javascript-sdk/client-side/entrypoint.sh +++ b/web-integrations/javascript-sdk/client-side/entrypoint.sh @@ -6,10 +6,16 @@ export UID_JS_SDK_NAME=${UID2_JS_SDK_NAME:-"__uid2"} export UID_BASE_URL=${UID2_BASE_URL:-"https://operator-integ.uidapi.com"} export SERVER_PUBLIC_KEY=${UID2_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} export SUBSCRIPTION_ID=${UID2_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} +export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} +export DOCS_BASE_URL=${DOCS_BASE_URL:-"https://unifiedid.com/docs"} # Process index.html template with environment variables envsubst < /usr/share/nginx/html/index.html > /usr/share/nginx/html/index.temp.html mv /usr/share/nginx/html/index.temp.html /usr/share/nginx/html/index.html +# Process iframe.html template with environment variables +envsubst < /usr/share/nginx/html/iframe.html > /usr/share/nginx/html/iframe.temp.html +mv /usr/share/nginx/html/iframe.temp.html /usr/share/nginx/html/iframe.html + # Start nginx exec nginx -g "daemon off;" diff --git a/web-integrations/javascript-sdk/client-side/html/iframe.html b/web-integrations/javascript-sdk/client-side/html/iframe.html index e34c8a07..7e985dc8 100644 --- a/web-integrations/javascript-sdk/client-side/html/iframe.html +++ b/web-integrations/javascript-sdk/client-side/html/iframe.html @@ -2,7 +2,7 @@ - Client-Side UID2 Integration Example using JavaScript SDK + Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK diff --git a/web-integrations/javascript-sdk/client-side/html/index.html b/web-integrations/javascript-sdk/client-side/html/index.html index 3d91542f..2e38abb8 100644 --- a/web-integrations/javascript-sdk/client-side/html/index.html +++ b/web-integrations/javascript-sdk/client-side/html/index.html @@ -2,7 +2,7 @@ - Client-Side UID2 Integration Example using JavaScript SDK + Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK @@ -89,13 +89,13 @@ -

Client-Side UID2 Integration Example using JavaScript SDK

+

Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK

This example demonstrates how a content publisher can follow the - Client-Side Integration Guide for JavaScript - to implement UID2 integration and generate UID2 tokens. + to implement ${PRODUCT_NAME} integration and generate ${PRODUCT_NAME} tokens. Note: This is a test-only integration environment—not for production use. It does not perform real user authentication or generate production-level tokens. Do not use real user data on this page. @@ -136,11 +136,11 @@

Client-Side UID2 Integration Example using JavaScript SDK

style="border-style: none" /> -
>
+
>
From 9ed1029c7e928edb822cd6e567f7dd0fceb3bb02 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 09:53:18 -0600 Subject: [PATCH 02/39] make variables names more general --- .../javascript-sdk/client-server/README.md | 30 ++++---- .../javascript-sdk/client-server/server.js | 10 +-- .../javascript-sdk/client-side/README.md | 26 +++---- .../javascript-sdk/client-side/entrypoint.sh | 10 +-- web-integrations/server-side/README.md | 42 ++++++---- web-integrations/server-side/server.js | 77 +++++++++++++++---- .../server-side/views/content.html | 2 +- web-integrations/server-side/views/error.html | 2 +- .../server-side/views/header.html | 8 +- web-integrations/server-side/views/index.html | 4 +- 10 files changed, 138 insertions(+), 73 deletions(-) diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 431edf29..debab37d 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -17,9 +17,9 @@ The easiest way to try the example is to use the following docker build command: ``` docker build . -t uid2-publisher-standard docker run -it --rm -p 3000:3000 \ - -e UID2_BASE_URL="https://operator-integ.uidapi.com" \ - -e UID2_API_KEY="{INTEG_API_KEY}" \ - -e UID2_CLIENT_SECRET="{CLIENT_SECRET}" \ + -e UID_BASE_URL="https://operator-integ.uidapi.com" \ + -e UID_API_KEY="{INTEG_API_KEY}" \ + -e UID_CLIENT_SECRET="{CLIENT_SECRET}" \ uid2-publisher-standard ``` @@ -27,27 +27,27 @@ If this command does not work in Powershell because of the `-e` variable, try ru ``` docker build . -t uid2-publisher-server -docker run -it --rm -p 3000:3000 -e "UID2_BASE_URL=https://operator-integ.uidapi.com" -e "UID2_API_KEY={INTEG_API_KEY}" -e "UID2_CLIENT_SECRET={CLIENT_SECRET}" uid2-publisher-server +docker run -it --rm -p 3000:3000 -e "UID_BASE_URL=https://operator-integ.uidapi.com" -e "UID_API_KEY={INTEG_API_KEY}" -e "UID_CLIENT_SECRET={CLIENT_SECRET}" uid2-publisher-server ``` The following table lists the environment variables that you must specify to start the application. ### Core Configuration -| Parameter | Data Type | Description | -| :------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `UID2_BASE_URL` | string | The base URL of the UID2/EUID service. Examples:
UID2 Testing: `https://operator-integ.uidapi.com`
EUID Testing: `https://integ.euid.eu/v2`
For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | -| `UID2_API_KEY` | string | Your UID2/EUID authentication key for the service specified in `UID2_BASE_URL`. | -| `UID2_CLIENT_SECRET` | string | Your UID2/EUID client secret for the service specified in `UID2_BASE_URL`. | -| `UID2_JS_SDK_URL` | string | URL to the JavaScript SDK. Examples:
UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | -| `UID2_JS_SDK_NAME` | string | Global variable name for the SDK. UID2: `__uid2`, EUID: `__euid` | +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `UID_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | +| `UID_API_KEY` | Your UID2/EUID authentication key for the service specified in `UID_BASE_URL` | Your API key from UID2/EUID portal | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the service specified in `UID_BASE_URL` | Your client secret from UID2/EUID portal | +| `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | +| `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | ### Display/UI Configuration -| Parameter | Data Type | Description | -| :------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `PRODUCT_NAME` | string | Product name for UI display (default: `UID2`, or `EUID`) | -| `DOCS_BASE_URL` | string | Documentation base URL (default: `https://unifiedid.com/docs`, or `https://euid.eu/docs`) | +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | After you see output similar to the following, the example application is up and running. diff --git a/web-integrations/javascript-sdk/client-server/server.js b/web-integrations/javascript-sdk/client-server/server.js index 781918d8..2cf3c828 100644 --- a/web-integrations/javascript-sdk/client-server/server.js +++ b/web-integrations/javascript-sdk/client-server/server.js @@ -9,15 +9,15 @@ const crypto = require('crypto'); const app = express(); const port = process.env.PORT || 3032; -const uid2BaseUrl = process.env.UID2_BASE_URL; -const uid2ApiKey = process.env.UID2_API_KEY; -const uid2ClientSecret = process.env.UID2_CLIENT_SECRET; +const uid2BaseUrl = process.env.UID_BASE_URL; +const uid2ApiKey = process.env.UID_API_KEY; +const uid2ClientSecret = process.env.UID_CLIENT_SECRET; // UI/Display configuration const productName = process.env.PRODUCT_NAME || 'UID2'; const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; -const uid2JsSdkUrl = process.env.UID2_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; -const uid2JsSdkName = process.env.UID2_JS_SDK_NAME || '__uid2'; +const uid2JsSdkUrl = process.env.UID_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; +const uid2JsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; const ivLength = 12; const nonceLength = 8; diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 115aab83..1da99109 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -36,21 +36,21 @@ docker run -p 3032:3032 --env-file .env javascript-sdk-client-side The application uses environment variables from the `.env` file in the base directory: ### Core Configuration -- `UID2_JS_SDK_URL` - URL to the UID2/EUID JavaScript SDK - - UID2 default: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js` - - EUID example: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` -- `UID2_JS_SDK_NAME` - Global variable name for the SDK - - UID2: `__uid2` - - EUID: `__euid` -- `UID2_BASE_URL` - API base URL - - UID2 default: `https://operator-integ.uidapi.com` - - EUID example: `https://integ.euid.eu/v2` -- `UID2_CSTG_SERVER_PUBLIC_KEY` - Server public key for client-side token generation -- `UID2_CSTG_SUBSCRIPTION_ID` - Subscription ID for client-side token generation + +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `UID_JS_SDK_URL` | URL to the UID2/EUID JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | +| `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | +| `UID_BASE_URL` | API base URL | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | +| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation | Your public key from UID2/EUID portal | +| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation | Your subscription ID from UID2/EUID portal | ### Display/UI Configuration -- `PRODUCT_NAME` - Product name for UI display (default: `UID2`, or `EUID`) -- `DOCS_BASE_URL` - Documentation base URL (default: `https://unifiedid.com/docs`, or `https://euid.eu/docs`) + +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | ## Accessing the Application diff --git a/web-integrations/javascript-sdk/client-side/entrypoint.sh b/web-integrations/javascript-sdk/client-side/entrypoint.sh index 15958059..58a6fa9c 100644 --- a/web-integrations/javascript-sdk/client-side/entrypoint.sh +++ b/web-integrations/javascript-sdk/client-side/entrypoint.sh @@ -1,11 +1,11 @@ #!/bin/sh # Set default values if not provided -export UID_JS_SDK_URL=${UID2_JS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"} -export UID_JS_SDK_NAME=${UID2_JS_SDK_NAME:-"__uid2"} -export UID_BASE_URL=${UID2_BASE_URL:-"https://operator-integ.uidapi.com"} -export SERVER_PUBLIC_KEY=${UID2_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} -export SUBSCRIPTION_ID=${UID2_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} +export UID_JS_SDK_URL=${UID_JS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"} +export UID_JS_SDK_NAME=${UID_JS_SDK_NAME:-"__uid2"} +export UID_BASE_URL=${UID_BASE_URL:-"https://operator-integ.uidapi.com"} +export SERVER_PUBLIC_KEY=${UID_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} +export SUBSCRIPTION_ID=${UID_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} export DOCS_BASE_URL=${DOCS_BASE_URL:-"https://unifiedid.com/docs"} diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 24d59072..6794a27e 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -1,8 +1,11 @@ -# Server-Side UID2 Integration Example +# Server-Side UID2/EUID Integration Example -[This example](https://example-srvonly-integ.uidapi.com/) demonstrates how a content publisher can use the [UID2 services](https://unifiedid.com/docs/intro) to implement the [server-side UID2 integration workflow](https://unifiedid.com/docs/guides/integration-publisher-server-side). +[This example](https://example-srvonly-integ.uidapi.com/) demonstrates how a content publisher can use the UID2/EUID services to implement the server-side UID2/EUID integration workflow without using an SDK. -For an example application using the [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), see [Client-Server UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-server/README.md) or [Client-Side UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-side/README.md). +- For UID2: [UID2 services](https://unifiedid.com/docs/intro), [server-side UID2 integration workflow](https://unifiedid.com/docs/guides/integration-publisher-server-side) +- For EUID: [EUID services](https://euid.eu/docs/intro), [server-side EUID integration workflow](https://euid.eu/docs/guides/integration-publisher-server-side) + +For an example application using the SDK, see [Client-Server UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-server/README.md) or [Client-Side UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-side/README.md). >NOTE: While the server side of the example application is implemented in JavaScript using node.js, it is not a requirement. You can use any technology of your choice and refer to the example application for illustration of the functionality that needs to be implemented. @@ -33,21 +36,30 @@ docker build -f web-integrations/server-side/Dockerfile -t server-side . # Run the container docker run -it --rm -p 3033:3033 \ - -e UID2_BASE_URL="https://operator-integ.uidapi.com" \ - -e UID2_API_KEY="{INTEG_API_KEY}" \ - -e UID2_CLIENT_SECRET="{CLIENT_KEY}" \ + -e UID_BASE_URL="https://operator-integ.uidapi.com" \ + -e UID_API_KEY="{INTEG_API_KEY}" \ + -e UID_CLIENT_SECRET="{CLIENT_KEY}" \ -e SESSION_KEY="{SESSION_KEY}" \ server-side ``` The following table lists the environment variables that you must specify to start the application. -| Parameter | Data Type | Description | -|:---------------------|:----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `UID2_BASE_URL` | string | The base URL of the UID2 service. For example:
Testing environment: `https://operator-integ.uidapi.com`
For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments). | -| `UID2_API_KEY` | string | Your UID2 authentication key for the UID2 service specified in `UID2_BASE_URL`. | | -| `UID2_CLIENT_SECRET` | string | Your UID2 client secret for the UID2 service specified in `UID2_BASE_URL`. | | -| `SESSION_KEY` | string | The key to the encryption session data stored in the application session cookie. This can be any arbitrary string. | | +### Core Configuration + +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `UID_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | +| `UID_API_KEY` | Your UID2/EUID authentication key for the service specified in `UID_BASE_URL` | Your API key from UID2/EUID portal | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the service specified in `UID_BASE_URL` | Your client secret from UID2/EUID portal | +| `SESSION_KEY` | The key to the encryption session data stored in the application session cookie. This can be any arbitrary string. | Any secure random string | + +### Display/UI Configuration + +| Variable | Description | Example Values | +|:---------|:------------|:---------------| +| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | After you see output similar to the following, the example application is up and running. @@ -62,13 +74,15 @@ If needed, to close the application, terminate the docker container or use the ` ## Test the Example Application -The example application illustrates the steps documented in the [Server-Only UID2 Integration Guide](https://unifiedid.com/docs/guides/custom-publisher-integration). +The example application illustrates the steps documented in the server-side integration guides: +- UID2: [Server-Side UID2 Integration Guide](https://unifiedid.com/docs/guides/custom-publisher-integration) +- EUID: [Server-Side EUID Integration Guide](https://euid.eu/docs/guides/custom-publisher-integration) The application provides three main pages: index (main), example content 1, and example content 2. Access to these pages is possible only after the user completes the login process. If the user is not logged in, they will be redirected to the login page. Submitting the login form simulates logging in to a publisher's application in the real world. Normally the login would require checking the user's secure credentials (for example, a password), but for demonstration purposes this -step is omitted, and the login process focuses on integration with the UID2 services instead. +step is omitted, and the login process focuses on integration with the UID2/EUID services instead. The following table outlines and annotates the steps you may take to test and explore the example application. diff --git a/web-integrations/server-side/server.js b/web-integrations/server-side/server.js index faedcda1..f8dec571 100644 --- a/web-integrations/server-side/server.js +++ b/web-integrations/server-side/server.js @@ -10,9 +10,13 @@ const crypto = require('crypto'); const app = express(); const port = process.env.PORT || 3033; -const uid2BaseUrl = process.env.UID2_BASE_URL; -const uid2ApiKey = process.env.UID2_API_KEY; -const uid2ClientSecret = process.env.UID2_CLIENT_SECRET; +const uid2BaseUrl = process.env.UID_BASE_URL; +const uid2ApiKey = process.env.UID_API_KEY; +const uid2ClientSecret = process.env.UID_CLIENT_SECRET; + +// UI/Display configuration +const productName = process.env.PRODUCT_NAME || 'UID2'; +const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const ivLength = 12; const nonceLength = 8; @@ -163,20 +167,37 @@ async function protect(req, res, next){ } app.get('/', protect, (req, res) => { - res.render('index', { identity: req.session.identity }); + res.render('index', { + identity: req.session.identity, + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); app.get('/content1', protect, (req, res) => { - res.render('content', { identity: req.session.identity, content: 'First Sample Content' }); + res.render('content', { + identity: req.session.identity, + content: 'First Sample Content', + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); app.get('/content2', protect, (req, res) => { - res.render('content', { identity: req.session.identity, content: 'Second Sample Content' }); + res.render('content', { + identity: req.session.identity, + content: 'Second Sample Content', + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); app.get('/login', async (req, res) => { if (await verifyIdentity(req)) { res.redirect('/'); } else { req.session = null; - res.render('login'); + res.render('login', { + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); @@ -185,16 +206,31 @@ function _GenerateTokenV1(req, res) { axios.get(uid2BaseUrl + '/v1/token/generate?email=' + encodeURIComponent(req.body.email), { headers: { 'Authorization': 'Bearer ' + uid2ApiKey } }) .then((response) => { if (response.data.status !== 'success') { - res.render('error', { error: 'Got unexpected token generate status: ' + response.data.status, response: response }); + res.render('error', { + error: 'Got unexpected token generate status: ' + response.data.status, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else if (typeof response.data.body !== 'object') { - res.render('error', { error: 'Unexpected token generate response format: ' + response.data, response: response }); + res.render('error', { + error: 'Unexpected token generate response format: ' + response.data, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else { req.session.identity = response.data.body; res.redirect('/'); } }) .catch((error) => { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); } @@ -214,15 +250,30 @@ app.post('/login', async (req, res) => { const response = decrypt(encryptedResponse.data, uid2ClientSecret, false, nonce); if (response.status !== 'success') { - res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response }); + res.render('error', { + error: 'Got unexpected token generate status in decrypted response: ' + response.status, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else if (typeof response.body !== 'object') { - res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response }); + res.render('error', { + error: 'Unexpected token generate response format in decrypted response: ' + response, + response: response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else { req.session.identity = response.body; res.redirect('/'); } } catch (error) { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); diff --git a/web-integrations/server-side/views/content.html b/web-integrations/server-side/views/content.html index 4f86f4d1..95fcdb94 100644 --- a/web-integrations/server-side/views/content.html +++ b/web-integrations/server-side/views/content.html @@ -1,5 +1,5 @@ <%- include('header.html'); -%> -

Protected Content — accessible only with a valid UID2 identity:

+

Protected Content — accessible only with a valid <%- productName %> identity:

<%= content %>

Back to the main page

<%- include('identity.html'); -%> diff --git a/web-integrations/server-side/views/error.html b/web-integrations/server-side/views/error.html index 25ddea9d..998c57d8 100644 --- a/web-integrations/server-side/views/error.html +++ b/web-integrations/server-side/views/error.html @@ -1,7 +1,7 @@ <%- include('header.html'); -%>

Something went wrong:

<%= error %>
-

Response from the UID2 operator:

+

Response from the <%- productName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/server-side/views/header.html b/web-integrations/server-side/views/header.html index 9d882bbe..27790f39 100644 --- a/web-integrations/server-side/views/header.html +++ b/web-integrations/server-side/views/header.html @@ -2,12 +2,12 @@ - Server-Side UID2 Integration Example + Server-Side <%- productName %> Integration Example -

Server-Side UID2 Integration Example

-

This example demonstrates how a content publisher can use UID2 services to implement the - server-side UID2 integration workflow. +

Server-Side <%- productName %> Integration Example

+

This example demonstrates how a content publisher can use <%- productName %> services to implement the + server-side <%- productName %> integration workflow. [Source Code]

diff --git a/web-integrations/server-side/views/index.html b/web-integrations/server-side/views/index.html index 8d45f73f..9d34edce 100644 --- a/web-integrations/server-side/views/index.html +++ b/web-integrations/server-side/views/index.html @@ -1,9 +1,9 @@ <%- include('header.html'); -%> -

Protected Content — accessible only with a valid UID2 identity:

+

Protected Content — accessible only with a valid <%- productName %> identity:

-

Current UID2 Identity:

+

Current <%- productName %> Identity:

<%- include('identity.html'); -%> <%- include('footer.html'); -%> From 6d28f2e20a94656e892d5c045aa10a0940f3c589 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 10:08:15 -0600 Subject: [PATCH 03/39] update final variables names for js sdk after testing --- web-integrations/javascript-sdk/client-side/README.md | 3 ++- web-integrations/javascript-sdk/client-side/entrypoint.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 1da99109..662144fb 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -41,7 +41,8 @@ The application uses environment variables from the `.env` file in the base dire |:---------|:------------|:---------------| | `UID_JS_SDK_URL` | URL to the UID2/EUID JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | -| `UID_BASE_URL` | API base URL | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | +| `UID_CLIENT_BASE_URL` | API base URL for client-side/browser calls | UID2: `https://operator-integ.uidapi.com` or `http://localhost:8080`
EUID: `https://integ.euid.eu/v2` | +| `UID_BASE_URL` | Fallback API base URL (used if `UID_CLIENT_BASE_URL` not set) | Same as above | | `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation | Your public key from UID2/EUID portal | | `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation | Your subscription ID from UID2/EUID portal | diff --git a/web-integrations/javascript-sdk/client-side/entrypoint.sh b/web-integrations/javascript-sdk/client-side/entrypoint.sh index 58a6fa9c..e171a25f 100644 --- a/web-integrations/javascript-sdk/client-side/entrypoint.sh +++ b/web-integrations/javascript-sdk/client-side/entrypoint.sh @@ -3,7 +3,8 @@ # Set default values if not provided export UID_JS_SDK_URL=${UID_JS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"} export UID_JS_SDK_NAME=${UID_JS_SDK_NAME:-"__uid2"} -export UID_BASE_URL=${UID_BASE_URL:-"https://operator-integ.uidapi.com"} +# Use CLIENT_BASE_URL for browser calls, fallback to BASE_URL if not set +export UID_BASE_URL=${UID_CLIENT_BASE_URL:-${UID_BASE_URL:-"https://operator-integ.uidapi.com"}} export SERVER_PUBLIC_KEY=${UID_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} export SUBSCRIPTION_ID=${UID_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} From 8fcf4e2d8fa4f7d9ce298dd45b6bbf3fcf9bbddc Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 10:27:32 -0600 Subject: [PATCH 04/39] update env.sample with new names --- .env.sample | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.sample b/.env.sample index c89974be..22275ba4 100644 --- a/.env.sample +++ b/.env.sample @@ -1,9 +1,9 @@ # ============================================================================== -# UID2 Examples Environment Configuration +# Environment Configuration # ============================================================================== # Copy this file to .env and update the values for your local development setup. # -# This file contains configuration for different UID2 integration examples. +# This file contains configuration for different UID2/EUID integration examples. # Not all variables are needed for all examples - see comments below. # ============================================================================== @@ -11,9 +11,9 @@ # Server-Side & Client-Server Examples # ------------------------------------------------------------------------------ -UID2_BASE_URL="https://operator-integ.uidapi.com" # For local development using Docker, use: http://host.docker.internal:8080 -UID2_API_KEY="your-api-key" -UID2_CLIENT_SECRET="your-client-secret" +UID_BASE_URL="https://operator-integ.uidapi.com" # For local development using Docker, use: http://host.docker.internal:8080 +UID_API_KEY="your-api-key" +UI_CLIENT_SECRET="your-client-secret" SESSION_KEY="your-session-key-here" # ------------------------------------------------------------------------------ @@ -21,16 +21,16 @@ SESSION_KEY="your-session-key-here" # ------------------------------------------------------------------------------ # For local development with Docker, use UID2_BASE_URL="http://localhost:8080" -UID2_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" -UID2_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" +UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" +UID_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" # ------------------------------------------------------------------------------ # JavaScript SDK Configuration # ------------------------------------------------------------------------------ -UID2_JS_SDK_URL="https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js" -UID2_JS_SDK_NAME="__uid2" -UID2_STORAGE_KEY="__uid2_advertising_token" +UID_JS_SDK_URL="https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js" +UID_JS_SDK_NAME="__uid2" +UID_STORAGE_KEY="__uid2_advertising_token" # ------------------------------------------------------------------------------ # React Client-Side Example From a02803b999c212d9d7ce81c50b0f79c93b1ce470 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 10:54:33 -0600 Subject: [PATCH 05/39] push additonal variables for google secure signals and update env files --- .env.sample | 41 ---------- .env.sample.euid | 43 +++++++++++ .env.sample.uid2 | 43 +++++++++++ README.md | 39 +++++++--- .../client-server/server.js | 47 ++++++++++-- .../client-server/views/error.html | 4 +- .../client-server/views/index.html | 38 +++++----- .../client-server/views/intro.html | 12 +-- .../client-server/views/login.html | 21 +++--- .../client-server/views/optout.html | 4 +- .../client-side/entrypoint.sh | 15 ++-- .../client-side/html/index.html | 20 ++--- .../client-side/html/scripts/scripts.js | 35 +++++---- .../src/SecureSignalsApp.tsx | 75 +++++++++++-------- .../server-side/server.js | 57 +++++++++++--- .../server-side/views/error.html | 2 +- .../server-side/views/header.html | 14 ++-- .../server-side/views/identity.html | 2 +- .../server-side/views/login.html | 2 +- .../server-side/views/optout.html | 2 +- 20 files changed, 341 insertions(+), 175 deletions(-) delete mode 100644 .env.sample create mode 100644 .env.sample.euid create mode 100644 .env.sample.uid2 diff --git a/.env.sample b/.env.sample deleted file mode 100644 index 22275ba4..00000000 --- a/.env.sample +++ /dev/null @@ -1,41 +0,0 @@ -# ============================================================================== -# Environment Configuration -# ============================================================================== -# Copy this file to .env and update the values for your local development setup. -# -# This file contains configuration for different UID2/EUID integration examples. -# Not all variables are needed for all examples - see comments below. -# ============================================================================== - -# ------------------------------------------------------------------------------ -# Server-Side & Client-Server Examples -# ------------------------------------------------------------------------------ - -UID_BASE_URL="https://operator-integ.uidapi.com" # For local development using Docker, use: http://host.docker.internal:8080 -UID_API_KEY="your-api-key" -UI_CLIENT_SECRET="your-client-secret" -SESSION_KEY="your-session-key-here" - -# ------------------------------------------------------------------------------ -# Client-Side Examples (all client-side token generation examples) -# ------------------------------------------------------------------------------ - -# For local development with Docker, use UID2_BASE_URL="http://localhost:8080" -UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" -UID_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" - -# ------------------------------------------------------------------------------ -# JavaScript SDK Configuration -# ------------------------------------------------------------------------------ - -UID_JS_SDK_URL="https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js" -UID_JS_SDK_NAME="__uid2" -UID_STORAGE_KEY="__uid2_advertising_token" - -# ------------------------------------------------------------------------------ -# React Client-Side Example -# ------------------------------------------------------------------------------ - -REACT_APP_UID2_BASE_URL="https://operator-integ.uidapi.com" # For local development using npm start, use: http://localhost:8080 -REACT_APP_UID2_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" -REACT_APP_UID2_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" diff --git a/.env.sample.euid b/.env.sample.euid new file mode 100644 index 00000000..3e64d6ca --- /dev/null +++ b/.env.sample.euid @@ -0,0 +1,43 @@ +# ============================================================================== +# EUID Environment Configuration +# ============================================================================== + +# Core API +UID_BASE_URL="https://integ.euid.eu" +UID_CLIENT_BASE_URL="https://integ.euid.eu" +UID_API_KEY="your-api-key" +UID_CLIENT_SECRET="your-client-secret" + +# Server-Side +SESSION_KEY="your-session-key-here" + +# Client-Side Token Generation (CSTG) +UID_CSTG_SERVER_PUBLIC_KEY="your-euid-server-public-key" +UID_CSTG_SUBSCRIPTION_ID="your-euid-subscription-id" + +# JavaScript SDK +UID_JS_SDK_URL="https://cdn.integ.euid.eu/euid-sdk-4.0.1.js" +UID_JS_SDK_NAME="__euid" + +# Google Secure Signals +UID_SECURE_SIGNALS_SDK_URL="https://cdn.integ.euid.eu/euidSecureSignal.js" +UID_SECURE_SIGNALS_STORAGE_KEY="_GESPSK-euid.eu" + +# Prebid +UID_STORAGE_KEY="__euid_advertising_token" + +# UI / Display +PRODUCT_NAME="EUID" +DOCS_BASE_URL="https://euid.eu/docs" + +# React Client Example +REACT_APP_UID_BASE_URL="https://integ.euid.eu" +REACT_APP_UID_CLIENT_BASE_URL="https://integ.euid.eu" +REACT_APP_UID_CSTG_SERVER_PUBLIC_KEY="your-euid-server-public-key" +REACT_APP_UID_CSTG_SUBSCRIPTION_ID="your-euid-subscription-id" +REACT_APP_UID_JS_SDK_NAME="__euid" +REACT_APP_UID_SECURE_SIGNALS_SDK_URL="https://cdn.integ.euid.eu/euidSecureSignal.js" +REACT_APP_UID_SECURE_SIGNALS_STORAGE_KEY="_GESPSK-euid.eu" +REACT_APP_PRODUCT_NAME="EUID" +REACT_APP_DOCS_BASE_URL="https://euid.eu/docs" + diff --git a/.env.sample.uid2 b/.env.sample.uid2 new file mode 100644 index 00000000..e87205b5 --- /dev/null +++ b/.env.sample.uid2 @@ -0,0 +1,43 @@ +# ============================================================================== +# UID2 Environment Configuration +# ============================================================================== + +# Core API +UID_BASE_URL="https://operator-integ.uidapi.com" +UID_CLIENT_BASE_URL="https://operator-integ.uidapi.com" +UID_API_KEY="your-api-key" +UID_CLIENT_SECRET="your-client-secret" + +# Server-Side +SESSION_KEY="your-session-key-here" + +# Client-Side Token Generation (CSTG) +UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" +UID_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" + +# JavaScript SDK +UID_JS_SDK_URL="https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js" +UID_JS_SDK_NAME="__uid2" + +# Google Secure Signals +UID_SECURE_SIGNALS_SDK_URL="https://cdn.integ.uidapi.com/uid2SecureSignal.js" +UID_SECURE_SIGNALS_STORAGE_KEY="_GESPSK-uidapi.com" + +# Prebid +UID_STORAGE_KEY="__uid2_advertising_token" + +# UI / Display +PRODUCT_NAME="UID2" +DOCS_BASE_URL="https://unifiedid.com/docs" + +# React Client Example +REACT_APP_UID_BASE_URL="https://operator-integ.uidapi.com" +REACT_APP_UID_CLIENT_BASE_URL="https://operator-integ.uidapi.com" +REACT_APP_UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" +REACT_APP_UID_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" +REACT_APP_UID_JS_SDK_NAME="__uid2" +REACT_APP_UID_SECURE_SIGNALS_SDK_URL="https://cdn.integ.uidapi.com/uid2SecureSignal.js" +REACT_APP_UID_SECURE_SIGNALS_STORAGE_KEY="_GESPSK-uidapi.com" +REACT_APP_PRODUCT_NAME="UID2" +REACT_APP_DOCS_BASE_URL="https://unifiedid.com/docs" + diff --git a/README.md b/README.md index 31ae2531..dfec8c8b 100644 --- a/README.md +++ b/README.md @@ -77,15 +77,32 @@ docker-compose up -d --build prebid-client ### Environment Configuration -Edit the `.env` file in the base directory to configure your UID2 settings: -``` -# UID2 Configuration for all services -UID2_BASE_URL="http://localhost:8080" -SERVER_PUBLIC_KEY="your-public-key" -SUBSCRIPTION_ID="your-subscription-id" - -# Additional variables for client-server example -UID2_API_KEY="your-api-key" -UID2_CLIENT_SECRET="your-client-secret" -``` +This repository includes sample environment files for both UID2 and EUID configurations: + +- **`.env.sample.uid2`** - UID2 configuration template +- **`.env.sample.euid`** - EUID configuration template + +**To get started:** + +1. Copy the appropriate sample file to `.env`: + ```bash + # For UID2 + cp .env.sample.uid2 .env + + # For EUID + cp .env.sample.euid .env + ``` + +2. Update the `.env` file with your credentials: + - Replace `your-api-key` with your actual API key + - Replace `your-client-secret` with your actual client secret + - Update other placeholder values as needed + +The sample files include all necessary environment variables for running the examples, including configuration for: +- Core API endpoints +- JavaScript SDK settings +- Google Secure Signals integration +- Prebid integration +- React client examples +- UI/Display preferences diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index ab2c8145..100d22fa 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -9,11 +9,20 @@ const crypto = require('crypto'); const app = express(); const port = process.env.PORT || 3041; -const uid2BaseUrl = process.env.UID2_BASE_URL; -const uid2ApiKey = process.env.UID2_API_KEY; -const uid2ClientSecret = process.env.UID2_CLIENT_SECRET; -const uid2JsSdkUrl = - process.env.UID2_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; +const uid2BaseUrl = process.env.UID_BASE_URL; +const uid2ApiKey = process.env.UID_API_KEY; +const uid2ClientSecret = process.env.UID_CLIENT_SECRET; + +// JavaScript SDK configuration +const uid2JsSdkUrl = process.env.UID_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; +const uid2JsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; + +// Secure Signals configuration +const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; + +// UI/Display configuration +const productName = process.env.PRODUCT_NAME || 'UID2'; +const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const ivLength = 12; const nonceLength = 8; @@ -27,7 +36,14 @@ app.engine('.html', ejs.__express); app.set('view engine', 'html'); app.get('/', (req, res) => { - res.render('index', { uid2BaseUrl: uid2BaseUrl, uid2JsSdkUrl: uid2JsSdkUrl }); + res.render('index', { + uid2BaseUrl: uid2BaseUrl, + uid2JsSdkUrl: uid2JsSdkUrl, + uid2JsSdkName: uid2JsSdkName, + secureSignalsSdkUrl: secureSignalsSdkUrl, + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); function bufferToBase64(arrayBuffer) { @@ -119,26 +135,43 @@ app.post('/login', async (req, res) => { res.render('optout', { uid2BaseUrl: uid2BaseUrl, uid2JsSdkUrl: uid2JsSdkUrl, + uid2JsSdkName: uid2JsSdkName, + secureSignalsSdkUrl: secureSignalsSdkUrl, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else if (response.status !== 'success') { res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else if (typeof response.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else { res.render('login', { identity: response.body, uid2BaseUrl: uid2BaseUrl, uid2JsSdkUrl: uid2JsSdkUrl, + uid2JsSdkName: uid2JsSdkName, + secureSignalsSdkUrl: secureSignalsSdkUrl, + productName: productName, + docsBaseUrl: docsBaseUrl }); } } catch (error) { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); diff --git a/web-integrations/google-secure-signals/client-server/views/error.html b/web-integrations/google-secure-signals/client-server/views/error.html index a7968c55..8ae07de1 100644 --- a/web-integrations/google-secure-signals/client-server/views/error.html +++ b/web-integrations/google-secure-signals/client-server/views/error.html @@ -2,7 +2,7 @@ - Error - Client-Server UID2 SDK Integration Example with Google Secure Signals + Error - Client-Server <%- productName %> SDK Integration Example with Google Secure Signals @@ -10,7 +10,7 @@ <%- include('intro.html'); -%>

Something went wrong:

<%= error %>
-

Response from the UID2 operator:

+

Response from the <%- productName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index ece21b81..b1e5d34c 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -2,7 +2,7 @@ - Client-Server UID2 SDK Integration Example with Google Secure Signals + Client-Server <%- productName %> SDK Integration Example with Google Secure Signals @@ -11,17 +11,19 @@ @@ -76,7 +80,7 @@ - + @@ -93,19 +97,19 @@

       
       
-        UID2 Advertising Token:
+        <%- productName %> Advertising Token:
         

       
       
-        Is UID2 Login Required?
+        Is <%- productName %> Login Required?
         

       
       
-        UID2 Identity Updated Counter:
+        <%- productName %> Identity Updated Counter:
         

       
       
-        UID2 Identity Callback State:
+        <%- productName %> Identity Callback State:
         

       
     
@@ -120,12 +124,12 @@
             style="border-style: none"
           />
         
-        
+
diff --git a/web-integrations/google-secure-signals/client-server/views/intro.html b/web-integrations/google-secure-signals/client-server/views/intro.html index d8473160..e36ae4c5 100644 --- a/web-integrations/google-secure-signals/client-server/views/intro.html +++ b/web-integrations/google-secure-signals/client-server/views/intro.html @@ -1,13 +1,13 @@ -

Client-Server UID2 SDK Integration Example with Google Secure Signals

+

Client-Server <%- productName %> SDK Integration Example with Google Secure Signals

- This example demonstrates how a content publisher can use the UID2 services and the - UID2 SDK for JavaScript services and the + <%- productName %> SDK for JavaScript to implement the client-server UID2 integration with Secure Signalsclient-server <%- productName %> integration with Secure Signals. [Source Code - Login - Client-Server UID2 SDK Integration Example with Google Secure Signals + Login - Client-Server <%- productName %> SDK Integration Example with Google Secure Signals - + <%- include('intro.html'); -%> -

Generate UID2 completed

-

UID2 identity:

+

Generate <%- productName %> completed

+

<%- productName %> identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

- Normally user would be redirected automatically, but this example demonstrates one way UID2 + Normally user would be redirected automatically, but this example demonstrates one way <%- productName %> generation could be handled.

diff --git a/web-integrations/google-secure-signals/client-server/views/optout.html b/web-integrations/google-secure-signals/client-server/views/optout.html index 00b1e2e7..812d1c40 100644 --- a/web-integrations/google-secure-signals/client-server/views/optout.html +++ b/web-integrations/google-secure-signals/client-server/views/optout.html @@ -2,7 +2,7 @@ - Opted Out - Client-Server UID2 SDK Integration Example with Google Secure Signals + Opted Out - Client-Server <%- productName %> SDK Integration Example with Google Secure Signals @@ -10,7 +10,7 @@ <%- include('intro.html'); -%>

This email has opted out

- The email address you entered has opted out of UID2. No UID2 token can be generated for this + The email address you entered has opted out of <%- productName %>. No <%- productName %> token can be generated for this email.

Back to the main page

diff --git a/web-integrations/google-secure-signals/client-side/entrypoint.sh b/web-integrations/google-secure-signals/client-side/entrypoint.sh index 581d5983..edca5986 100644 --- a/web-integrations/google-secure-signals/client-side/entrypoint.sh +++ b/web-integrations/google-secure-signals/client-side/entrypoint.sh @@ -1,11 +1,16 @@ #!/bin/sh # Set default values if not provided -export UID_JS_SDK_URL=${UID2_JS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"} -export UID_JS_SDK_NAME=${UID2_JS_SDK_NAME:-"__uid2"} -export UID_BASE_URL=${UID2_BASE_URL:-"https://operator-integ.uidapi.com"} -export SERVER_PUBLIC_KEY=${UID2_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} -export SUBSCRIPTION_ID=${UID2_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} +export UID_JS_SDK_URL=${UID_JS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js"} +export UID_JS_SDK_NAME=${UID_JS_SDK_NAME:-"__uid2"} +# Use CLIENT_BASE_URL for browser calls, fallback to BASE_URL if not set +export UID_BASE_URL=${UID_CLIENT_BASE_URL:-${UID_BASE_URL:-"https://operator-integ.uidapi.com"}} +export SERVER_PUBLIC_KEY=${UID_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} +export SUBSCRIPTION_ID=${UID_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} +export UID_SECURE_SIGNALS_SDK_URL=${UID_SECURE_SIGNALS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2SecureSignal.js"} +export UID_SECURE_SIGNALS_STORAGE_KEY=${UID_SECURE_SIGNALS_STORAGE_KEY:-"_GESPSK-uidapi.com"} +export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} +export DOCS_BASE_URL=${DOCS_BASE_URL:-"https://unifiedid.com/docs"} # Process index.html template with environment variables envsubst < /usr/share/nginx/html/index.html > /usr/share/nginx/html/index.temp.html diff --git a/web-integrations/google-secure-signals/client-side/html/index.html b/web-integrations/google-secure-signals/client-side/html/index.html index 0556cd74..6c7ffdd4 100644 --- a/web-integrations/google-secure-signals/client-side/html/index.html +++ b/web-integrations/google-secure-signals/client-side/html/index.html @@ -2,7 +2,7 @@ - Client-Side UID2 SDK Integration Example with Google Secure Signals + Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signals @@ -12,10 +12,10 @@ -

Client-Side UID2 SDK Integration Example with Google Secure Signals

+

Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signals

This example demonstrates how a content publisher can follow the - Client-Side Integration Guide for JavaScript to implement UID2 integration and generate UID2 tokens. + Client-Side Integration Guide for JavaScript to implement ${PRODUCT_NAME} integration and generate ${PRODUCT_NAME} tokens. Secure Signals is updated when the page is reloaded. Reload the page in order to update Secure Signals in local storage. Note: This is a test-only integration environment—not for production use. @@ -39,15 +39,15 @@

Client-Side UID2 SDK Integration Example with Google Secure Signals


         
         
-          UID2 Advertising Token:
+          ${PRODUCT_NAME} Advertising Token:
           

         
         
-          Is UID2 Login Required?
+          Is ${PRODUCT_NAME} Login Required?
           

         
         
-          UID2 Identity Callback State:
+          ${PRODUCT_NAME} Identity Callback State:
           

         
         
@@ -61,7 +61,7 @@ 

Client-Side UID2 SDK Integration Example with Google Secure Signals

-
+
- + diff --git a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js index 767f5b95..18bb51c0 100644 --- a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js +++ b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js @@ -7,15 +7,16 @@ const clientSideIdentityOptions = { let loginAttempted = false; function updateGuiElements(state) { - $('#targeted_advertising_ready').text(__uid2.getAdvertisingToken() ? 'yes' : 'no'); - const token = __uid2.getAdvertisingToken(); + const sdk = window['${UID_JS_SDK_NAME}']; + $('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no'); + const token = sdk.getAdvertisingToken(); $('#advertising_token').text(String(token)); $('#login_required').text( - __uid2.isLoginRequired() || __uid2.isLoginRequired() === undefined ? 'yes' : 'no' + sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no' ); $('#identity_state').text(String(JSON.stringify(state, null, 2))); - const uid2LoginRequired = __uid2.isLoginRequired(); + const uid2LoginRequired = sdk.isLoginRequired(); // Check for opt-out: only if user attempted login, and we got identity null with no token const isOptedOut = loginAttempted && !token && state?.identity === null; @@ -37,7 +38,8 @@ function updateGuiElements(state) { $('#optout_banner').hide(); } - const secureSignalsStorage = localStorage['_GESPSK-uidapi.com']; + const secureSignalsStorageKey = '${UID_SECURE_SIGNALS_STORAGE_KEY}'; + const secureSignalsStorage = localStorage[secureSignalsStorageKey]; if (token && !secureSignalsStorage) { //Token is valid but Secure Signals has not been refreshed. Reload the page. location.reload(); @@ -59,9 +61,12 @@ function onUid2IdentityUpdated(eventType, payload) { } function onDocumentReady() { + const sdkName = '${UID_JS_SDK_NAME}'; + const sdk = window[sdkName]; + $('#logout').click(() => { window.googletag.secureSignalProviders.clearAllCache(); - __uid2.disconnect(); + sdk.disconnect(); loginAttempted = false; // Reset flag }); @@ -71,7 +76,7 @@ function onDocumentReady() { loginAttempted = true; // Mark that user attempted to generate a token try { - await __uid2.setIdentityFromEmail(email, clientSideIdentityOptions); + await sdk.setIdentityFromEmail(email, clientSideIdentityOptions); } catch (e) { console.error('setIdentityFromEmail failed', e); } @@ -79,24 +84,26 @@ function onDocumentReady() { $('#try_another').click(() => { window.googletag.secureSignalProviders.clearAllCache(); - __uid2.disconnect(); + sdk.disconnect(); $('#email').val(''); loginAttempted = false; // Reset flag }); } -window.__uid2 = window.__uid2 || {}; -window.__uid2.callbacks = window.__uid2.callbacks || []; +const sdkName = '${UID_JS_SDK_NAME}'; +window[sdkName] = window[sdkName] || {}; +window[sdkName].callbacks = window[sdkName].callbacks || []; -window.__uid2.callbacks.push(onUid2IdentityUpdated); -window.__uid2.callbacks.push((eventType, payload) => { +window[sdkName].callbacks.push(onUid2IdentityUpdated); +window[sdkName].callbacks.push((eventType, payload) => { if (eventType === 'SdkLoaded') { - window.__uid2.init({ + const sdk = window[sdkName]; + sdk.init({ baseUrl: '${UID_BASE_URL}', }); $(document).ready(() => { // Clear any existing identity on page load for clean state - __uid2.disconnect(); + sdk.disconnect(); loginAttempted = false; onDocumentReady(); diff --git a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx index f59caa52..1c021335 100644 --- a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx +++ b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx @@ -3,7 +3,7 @@ import './styles/app.css'; import './styles/ads.css'; declare global { interface Window { - __uid2: any; + [key: string]: any; getAdvertisingToken: any; google: any; googletag: any; @@ -13,9 +13,17 @@ declare global { // Declare global variables declare const google: any; +// Environment variables with UID_ prefix for both UID2 and EUID +const UID_JS_SDK_NAME = process.env.REACT_APP_UID_JS_SDK_NAME || '__uid2'; +const UID_BASE_URL = process.env.REACT_APP_UID_CLIENT_BASE_URL || process.env.REACT_APP_UID_BASE_URL || 'https://operator-integ.uidapi.com'; +const SECURE_SIGNALS_SDK_URL = process.env.REACT_APP_UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; +const SECURE_SIGNALS_STORAGE_KEY = process.env.REACT_APP_UID_SECURE_SIGNALS_STORAGE_KEY || '_GESPSK-uidapi.com'; +const PRODUCT_NAME = process.env.REACT_APP_PRODUCT_NAME || 'UID2'; +const DOCS_BASE_URL = process.env.REACT_APP_DOCS_BASE_URL || 'https://unifiedid.com/docs'; + const clientSideIdentityOptions = { - subscriptionId: process.env.REACT_APP_UID2_CSTG_SUBSCRIPTION_ID || 'toPh8vgJgt', - serverPublicKey: process.env.REACT_APP_UID2_CSTG_SERVER_PUBLIC_KEY || + subscriptionId: process.env.REACT_APP_UID_CSTG_SUBSCRIPTION_ID || 'toPh8vgJgt', + serverPublicKey: process.env.REACT_APP_UID_CSTG_SERVER_PUBLIC_KEY || 'UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKAbPfOz7u25g1fL6riU7p2eeqhjmpALPeYoyjvZmZ1xM2NM8UeOmDZmCIBnKyRZ97pz5bMCjrs38WM22O7LJuw==', }; @@ -43,20 +51,21 @@ const SecureSignalsApp = () => { const loginAttemptedRef = useRef(false); const updateElements = useCallback((status) => { - const token = window.__uid2.getAdvertisingToken(); + const sdk = window[UID_JS_SDK_NAME]; + const token = sdk.getAdvertisingToken(); // Check for opt-out: only if user attempted login, and we got identity null with no token const optedOut = loginAttemptedRef.current && !token && status?.identity === null; setIsOptedOut(optedOut); - if (window.__uid2.getAdvertisingToken()) { + if (sdk.getAdvertisingToken()) { setTargetedAdvertisingReady(true); } else { setTargetedAdvertisingReady(false); } - setAdvertisingToken(String(window.__uid2.getAdvertisingToken())); + setAdvertisingToken(String(sdk.getAdvertisingToken())); - if (window.__uid2.isLoginRequired() === true) { + if (sdk.isLoginRequired() === true) { setLoginRequired(true); setIsLoggedIn(false); } else { @@ -79,7 +88,7 @@ const SecureSignalsApp = () => { const onUid2IdentityUpdated = useCallback( (eventType, payload) => { - console.log('UID2 Callback', payload); + console.log(`${PRODUCT_NAME} Callback`, payload); updateElements(payload); }, [updateElements] @@ -173,18 +182,19 @@ const SecureSignalsApp = () => { ); useEffect(() => { - // Add callbacks for UID2 JS SDK - window.__uid2.callbacks.push(onUid2IdentityUpdated); - window.__uid2.callbacks.push((eventType, payload) => { - let __uid2 = window.__uid2; + // Add callbacks for UID2/EUID JS SDK + const sdk = window[UID_JS_SDK_NAME]; + sdk.callbacks = sdk.callbacks || []; + sdk.callbacks.push(onUid2IdentityUpdated); + sdk.callbacks.push((eventType, payload) => { if (eventType === 'SdkLoaded') { - __uid2.init({ - baseUrl: process.env.REACT_APP_UID2_BASE_URL ||'https://operator-integ.uidapi.com', + sdk.init({ + baseUrl: UID_BASE_URL, }); } if (eventType === 'InitCompleted') { - if (__uid2.isLoginRequired()) { - __uid2.setIdentity(identity); + if (sdk.isLoginRequired()) { + sdk.setIdentity(identity); setIdentity(identity); } } @@ -243,7 +253,7 @@ const SecureSignalsApp = () => { const loadSecureSignals = () => { const script2 = document.createElement('script'); - script2.src = 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; + script2.src = SECURE_SIGNALS_SDK_URL; script2.async = true; script2.onload = () => { console.log('secure signals script loaded'); @@ -257,7 +267,8 @@ const SecureSignalsApp = () => { try { if (isEnabled('uid2')) { - await window.__uid2.setIdentityFromEmail(email, clientSideIdentityOptions); + const sdk = window[UID_JS_SDK_NAME]; + await sdk.setIdentityFromEmail(email, clientSideIdentityOptions); loadSecureSignals(); } } catch (e) { @@ -268,7 +279,8 @@ const SecureSignalsApp = () => { const handleLogout = () => { window.googletag.secureSignalProviders.clearAllCache(); if (isEnabled('uid2')) { - window.__uid2.disconnect(); + const sdk = window[UID_JS_SDK_NAME]; + sdk.disconnect(); } loginAttemptedRef.current = false; // Reset flag setIsOptedOut(false); @@ -277,7 +289,8 @@ const SecureSignalsApp = () => { const handleTryAnother = () => { window.googletag.secureSignalProviders.clearAllCache(); if (isEnabled('uid2')) { - window.__uid2.disconnect(); + const sdk = window[UID_JS_SDK_NAME]; + sdk.disconnect(); } setEmail(''); loginAttemptedRef.current = false; // Reset flag @@ -294,7 +307,7 @@ const SecureSignalsApp = () => { }; const updateSecureSignals = () => { - const secureSignalsStorage = localStorage['_GESPSK-uidapi.com']; + const secureSignalsStorage = localStorage[SECURE_SIGNALS_STORAGE_KEY]; const secureSignalsStorageJson = secureSignalsStorage && JSON.parse(secureSignalsStorage); if (secureSignalsStorageJson && secureSignalsStorageJson[1]) { setSecureSignalsLoaded(true); @@ -312,14 +325,14 @@ const SecureSignalsApp = () => { return (

- React Client-Side UID2 SDK Integration Example with Google Secure Signals + React Client-Side {PRODUCT_NAME} SDK Integration Example with Google Secure Signals

This example demonstrates how a content publisher can follow the{' '} - + Client-Side Integration Guide for JavaScript {' '} - to implement UID2 integration and generate UID2 tokens. Secure Signals is updated when the + to implement {PRODUCT_NAME} integration and generate {PRODUCT_NAME} tokens. Secure Signals is updated when the page is reloaded. Reload the page in order to update Secure Signals in local storage.

@@ -341,7 +354,7 @@ const SecureSignalsApp = () => { - UID2 Enabled{' '} + {PRODUCT_NAME} Enabled{' '} { - UID2 Advertising Token: + {PRODUCT_NAME} Advertising Token:
{advertisingToken}
- Is UID2 Login Required? + Is {PRODUCT_NAME} Login Required?
{loginRequired ? 'yes' : 'no'}
- UID2 Identity Callback State: + {PRODUCT_NAME} Identity Callback State:
{identityState}
@@ -395,7 +408,7 @@ const SecureSignalsApp = () => { {isOptedOut ? ( <>
-

The email address you entered has opted out of UID2.

+

The email address you entered has opted out of {PRODUCT_NAME}.

@@ -426,7 +439,7 @@ const SecureSignalsApp = () => {
diff --git a/web-integrations/google-secure-signals/server-side/server.js b/web-integrations/google-secure-signals/server-side/server.js index 3894407d..d9cadcf0 100644 --- a/web-integrations/google-secure-signals/server-side/server.js +++ b/web-integrations/google-secure-signals/server-side/server.js @@ -10,9 +10,16 @@ const crypto = require('crypto'); const app = express(); const port = process.env.PORT || 3043; -const uid2BaseUrl = process.env.UID2_BASE_URL; -const uid2ApiKey = process.env.UID2_API_KEY; -const uid2ClientSecret = process.env.UID2_CLIENT_SECRET; +const uid2BaseUrl = process.env.UID_BASE_URL; +const uid2ApiKey = process.env.UID_API_KEY; +const uid2ClientSecret = process.env.UID_CLIENT_SECRET; + +// Secure Signals configuration +const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; + +// UI/Display configuration +const productName = process.env.PRODUCT_NAME || 'UID2'; +const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const ivLength = 12; const nonceLength = 8; @@ -178,7 +185,12 @@ async function protect(req, res, next) { } app.get('/', protect, (req, res) => { - res.render('index', { identity: req.session.identity }); + res.render('index', { + identity: req.session.identity, + secureSignalsSdkUrl: secureSignalsSdkUrl, + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); app.get('/getFreshToken', protect, async (req, res) => { @@ -197,7 +209,10 @@ app.get('/login', async (req, res) => { res.redirect('/'); } else { req.session = null; - res.render('login'); + res.render('login', { + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); @@ -208,16 +223,23 @@ function _GenerateTokenV1(req, res) { }) .then((response) => { if (response.data.status === 'optout') { - res.render('optout'); + res.render('optout', { + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else if (response.data.status !== 'success') { res.render('error', { error: 'Got unexpected token generate status: ' + response.data.status, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else if (typeof response.data.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format: ' + response.data, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else { req.session.identity = response.data.body; @@ -225,7 +247,12 @@ function _GenerateTokenV1(req, res) { } }) .catch((error) => { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); }); } @@ -249,23 +276,35 @@ app.post('/login', async (req, res) => { const response = decrypt(encryptedResponse.data, uid2ClientSecret, false, nonce); if (response.status === 'optout') { - res.render('optout'); + res.render('optout', { + productName: productName, + docsBaseUrl: docsBaseUrl + }); } else if (response.status !== 'success') { res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else if (typeof response.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response, + productName: productName, + docsBaseUrl: docsBaseUrl }); } else { req.session.identity = response.body; res.redirect('/'); } } catch (error) { - res.render('error', { error: error, response: error.response }); + res.render('error', { + error: error, + response: error.response, + productName: productName, + docsBaseUrl: docsBaseUrl + }); } }); diff --git a/web-integrations/google-secure-signals/server-side/views/error.html b/web-integrations/google-secure-signals/server-side/views/error.html index 25ddea9d..998c57d8 100644 --- a/web-integrations/google-secure-signals/server-side/views/error.html +++ b/web-integrations/google-secure-signals/server-side/views/error.html @@ -1,7 +1,7 @@ <%- include('header.html'); -%>

Something went wrong:

<%= error %>
-

Response from the UID2 operator:

+

Response from the <%- productName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/google-secure-signals/server-side/views/header.html b/web-integrations/google-secure-signals/server-side/views/header.html index 1dc6273d..0f954cd4 100644 --- a/web-integrations/google-secure-signals/server-side/views/header.html +++ b/web-integrations/google-secure-signals/server-side/views/header.html @@ -2,11 +2,11 @@ - Server-Side UID2 Integration Example with Google Secure Signals + Server-Side <%- productName %> Integration Example with Google Secure Signals - + -

Server-Side UID2 Integration Example with Google Secure Signals

+

Server-Side <%- productName %> Integration Example with Google Secure Signals

- This example demonstrates how a content publisher can use the UID2 services to implement the - server-side UID2 integration workflow with Secure Signals. [ services to implement the + server-side <%- productName %> integration workflow with Secure Signals. [Source Code]

This assumes that the publisher has implemented - UID2 Server-Side integration - on the backend and is able to pass the resulting UID2 identity response to the front end. + <%- productName %> Server-Side integration + on the backend and is able to pass the resulting <%- productName %> identity response to the front end.

diff --git a/web-integrations/google-secure-signals/server-side/views/identity.html b/web-integrations/google-secure-signals/server-side/views/identity.html index 30d6b92a..3fe02f2f 100644 --- a/web-integrations/google-secure-signals/server-side/views/identity.html +++ b/web-integrations/google-secure-signals/server-side/views/identity.html @@ -5,6 +5,6 @@ onsubmit="return window.googletag.secureSignalProviders.clearAllCache()" >
- +
diff --git a/web-integrations/google-secure-signals/server-side/views/login.html b/web-integrations/google-secure-signals/server-side/views/login.html index 9ed293ae..1a445efc 100644 --- a/web-integrations/google-secure-signals/server-side/views/login.html +++ b/web-integrations/google-secure-signals/server-side/views/login.html @@ -9,6 +9,6 @@ style="border-style: none" /> -
+
<%- include('footer.html'); -%> diff --git a/web-integrations/google-secure-signals/server-side/views/optout.html b/web-integrations/google-secure-signals/server-side/views/optout.html index 051d9a20..b8ec18f0 100644 --- a/web-integrations/google-secure-signals/server-side/views/optout.html +++ b/web-integrations/google-secure-signals/server-side/views/optout.html @@ -3,7 +3,7 @@

This email has opted out

- The email address you entered has opted out of UID2. No UID2 token can be generated for this + The email address you entered has opted out of <%- productName %>. No <%- productName %> token can be generated for this email.

From 26efdeb70ee8ac26d1b49f3ac6d88ecb823a4135 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 11:01:21 -0600 Subject: [PATCH 06/39] update local variable names to match env variables --- .../client-server/server.js | 36 +++++++++---------- .../client-server/views/index.html | 4 +-- .../client-server/views/login.html | 6 ++-- .../server-side/server.js | 22 ++++++------ .../javascript-sdk/client-server/server.js | 24 ++++++------- .../client-server/views/index.html | 6 ++-- .../client-server/views/login.html | 6 ++-- web-integrations/server-side/server.js | 20 +++++------ 8 files changed, 62 insertions(+), 62 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index 100d22fa..a478c083 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -9,13 +9,13 @@ const crypto = require('crypto'); const app = express(); const port = process.env.PORT || 3041; -const uid2BaseUrl = process.env.UID_BASE_URL; -const uid2ApiKey = process.env.UID_API_KEY; -const uid2ClientSecret = process.env.UID_CLIENT_SECRET; +const uidBaseUrl = process.env.UID_BASE_URL; +const uidApiKey = process.env.UID_API_KEY; +const uidClientSecret = process.env.UID_CLIENT_SECRET; // JavaScript SDK configuration -const uid2JsSdkUrl = process.env.UID_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; -const uid2JsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; +const uidJsSdkUrl = process.env.UID_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; +const uidJsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; // Secure Signals configuration const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; @@ -37,9 +37,9 @@ app.set('view engine', 'html'); app.get('/', (req, res) => { res.render('index', { - uid2BaseUrl: uid2BaseUrl, - uid2JsSdkUrl: uid2JsSdkUrl, - uid2JsSdkName: uid2JsSdkName, + uidBaseUrl: uidBaseUrl, + uidJsSdkUrl: uidJsSdkUrl, + uidJsSdkName: uidJsSdkName, secureSignalsSdkUrl: secureSignalsSdkUrl, productName: productName, docsBaseUrl: docsBaseUrl @@ -106,7 +106,7 @@ function createEnvelope(payload) { const payloadEncoded = new TextEncoder().encode(payload); const body = Buffer.concat([Buffer.from(new Uint8Array(bufferMillisec)), nonce, payloadEncoded]); - const { ciphertext, iv } = encryptRequest(body, uid2ClientSecret); + const { ciphertext, iv } = encryptRequest(body, uidClientSecret); const envelopeVersion = Buffer.alloc(1, 1); const envelope = bufferToBase64( @@ -120,22 +120,22 @@ app.post('/login', async (req, res) => { const { envelope, nonce } = createEnvelope(jsonEmail); const headers = { - headers: { Authorization: 'Bearer ' + uid2ApiKey }, + headers: { Authorization: 'Bearer ' + uidApiKey }, }; try { const encryptedResponse = await axios.post( - uid2BaseUrl + '/v2/token/generate', + uidBaseUrl + '/v2/token/generate', envelope, headers ); //if HTTP response code is not 200, this throws and is caught in the catch handler below. - const response = decrypt(encryptedResponse.data, uid2ClientSecret, nonce); + const response = decrypt(encryptedResponse.data, uidClientSecret, nonce); if (response.status === 'optout') { res.render('optout', { - uid2BaseUrl: uid2BaseUrl, - uid2JsSdkUrl: uid2JsSdkUrl, - uid2JsSdkName: uid2JsSdkName, + uidBaseUrl: uidBaseUrl, + uidJsSdkUrl: uidJsSdkUrl, + uidJsSdkName: uidJsSdkName, secureSignalsSdkUrl: secureSignalsSdkUrl, productName: productName, docsBaseUrl: docsBaseUrl @@ -157,9 +157,9 @@ app.post('/login', async (req, res) => { } else { res.render('login', { identity: response.body, - uid2BaseUrl: uid2BaseUrl, - uid2JsSdkUrl: uid2JsSdkUrl, - uid2JsSdkName: uid2JsSdkName, + uidBaseUrl: uidBaseUrl, + uidJsSdkUrl: uidJsSdkUrl, + uidJsSdkName: uidJsSdkName, secureSignalsSdkUrl: secureSignalsSdkUrl, productName: productName, docsBaseUrl: docsBaseUrl diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index b1e5d34c..217c60d4 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -59,7 +59,7 @@ if (eventType === "SdkLoaded") { const sdk = window[sdkName]; sdk.init({ - baseUrl: "<%- uid2BaseUrl %>", + baseUrl: "<%- uidBaseUrl %>", enableSecureSignals: true, }); } @@ -81,7 +81,7 @@ - + diff --git a/web-integrations/google-secure-signals/client-server/views/login.html b/web-integrations/google-secure-signals/client-server/views/login.html index 4dc70f0d..a704de7e 100644 --- a/web-integrations/google-secure-signals/client-server/views/login.html +++ b/web-integrations/google-secure-signals/client-server/views/login.html @@ -6,17 +6,17 @@ - + - + + @@ -28,12 +28,12 @@ <%- include('intro.html'); -%> -

Generate <%- productName %> completed

-

<%- productName %> identity:

+

Generate <%- identityName %> completed

+

<%- identityName %> identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

- Normally user would be redirected automatically, but this example demonstrates one way <%- productName %> + Normally user would be redirected automatically, but this example demonstrates one way <%- identityName %> generation could be handled.

diff --git a/web-integrations/google-secure-signals/client-server/views/optout.html b/web-integrations/google-secure-signals/client-server/views/optout.html index 812d1c40..b6957e4c 100644 --- a/web-integrations/google-secure-signals/client-server/views/optout.html +++ b/web-integrations/google-secure-signals/client-server/views/optout.html @@ -2,7 +2,7 @@ - Opted Out - Client-Server <%- productName %> SDK Integration Example with Google Secure Signals + Opted Out - Client-Server <%- identityName %> SDK Integration Example with Google Secure Signals @@ -10,7 +10,7 @@ <%- include('intro.html'); -%>

This email has opted out

- The email address you entered has opted out of <%- productName %>. No <%- productName %> token can be generated for this + The email address you entered has opted out of <%- identityName %>. No <%- identityName %> token can be generated for this email.

Back to the main page

diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index f858f1d1..f634e890 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -42,7 +42,7 @@ The example app will be up and running at `http://localhost:3000` | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | | `UID_SECURE_SIGNALS_STORAGE_KEY` | Local storage key for Secure Signals | UID2: `_GESPSK-uidapi.com`
EUID: `_GESPSK-euid.eu` | -| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | If needed, to close the application, terminate the docker container or use the `Ctrl+C` keyboard shortcut. diff --git a/web-integrations/google-secure-signals/client-side/entrypoint.sh b/web-integrations/google-secure-signals/client-side/entrypoint.sh index edca5986..786ecdc6 100644 --- a/web-integrations/google-secure-signals/client-side/entrypoint.sh +++ b/web-integrations/google-secure-signals/client-side/entrypoint.sh @@ -9,7 +9,7 @@ export SERVER_PUBLIC_KEY=${UID_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0 export SUBSCRIPTION_ID=${UID_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} export UID_SECURE_SIGNALS_SDK_URL=${UID_SECURE_SIGNALS_SDK_URL:-"https://cdn.integ.uidapi.com/uid2SecureSignal.js"} export UID_SECURE_SIGNALS_STORAGE_KEY=${UID_SECURE_SIGNALS_STORAGE_KEY:-"_GESPSK-uidapi.com"} -export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} +export IDENTITY_NAME=${IDENTITY_NAME:-"UID2"} export DOCS_BASE_URL=${DOCS_BASE_URL:-"https://unifiedid.com/docs"} # Process index.html template with environment variables diff --git a/web-integrations/google-secure-signals/client-side/html/index.html b/web-integrations/google-secure-signals/client-side/html/index.html index 6c7ffdd4..249a3b4c 100644 --- a/web-integrations/google-secure-signals/client-side/html/index.html +++ b/web-integrations/google-secure-signals/client-side/html/index.html @@ -2,7 +2,7 @@ - Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signals + Client-Side ${IDENTITY_NAME} SDK Integration Example with Google Secure Signals @@ -12,10 +12,10 @@ -

Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signals

+

Client-Side ${IDENTITY_NAME} SDK Integration Example with Google Secure Signals

This example demonstrates how a content publisher can follow the - Client-Side Integration Guide for JavaScript to implement ${PRODUCT_NAME} integration and generate ${PRODUCT_NAME} tokens. + Client-Side Integration Guide for JavaScript to implement ${IDENTITY_NAME} integration and generate ${IDENTITY_NAME} tokens. Secure Signals is updated when the page is reloaded. Reload the page in order to update Secure Signals in local storage. Note: This is a test-only integration environment—not for production use. @@ -39,15 +39,15 @@

Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signa

         
         
-          ${PRODUCT_NAME} Advertising Token:
+          ${IDENTITY_NAME} Advertising Token:
           

         
         
-          Is ${PRODUCT_NAME} Login Required?
+          Is ${IDENTITY_NAME} Login Required?
           

         
         
-          ${PRODUCT_NAME} Identity Callback State:
+          ${IDENTITY_NAME} Identity Callback State:
           

         
         
@@ -61,7 +61,7 @@ 

Client-Side ${PRODUCT_NAME} SDK Integration Example with Google Secure Signa -
+
diff --git a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx index 1c021335..469f4af1 100644 --- a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx +++ b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx @@ -18,7 +18,7 @@ const UID_JS_SDK_NAME = process.env.REACT_APP_UID_JS_SDK_NAME || '__uid2'; const UID_BASE_URL = process.env.REACT_APP_UID_CLIENT_BASE_URL || process.env.REACT_APP_UID_BASE_URL || 'https://operator-integ.uidapi.com'; const SECURE_SIGNALS_SDK_URL = process.env.REACT_APP_UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; const SECURE_SIGNALS_STORAGE_KEY = process.env.REACT_APP_UID_SECURE_SIGNALS_STORAGE_KEY || '_GESPSK-uidapi.com'; -const PRODUCT_NAME = process.env.REACT_APP_PRODUCT_NAME || 'UID2'; +const IDENTITY_NAME = process.env.REACT_APP_IDENTITY_NAME || 'UID2'; const DOCS_BASE_URL = process.env.REACT_APP_DOCS_BASE_URL || 'https://unifiedid.com/docs'; const clientSideIdentityOptions = { @@ -88,7 +88,7 @@ const SecureSignalsApp = () => { const onUid2IdentityUpdated = useCallback( (eventType, payload) => { - console.log(`${PRODUCT_NAME} Callback`, payload); + console.log(`${IDENTITY_NAME} Callback`, payload); updateElements(payload); }, [updateElements] @@ -325,14 +325,14 @@ const SecureSignalsApp = () => { return (

- React Client-Side {PRODUCT_NAME} SDK Integration Example with Google Secure Signals + React Client-Side {IDENTITY_NAME} SDK Integration Example with Google Secure Signals

This example demonstrates how a content publisher can follow the{' '} Client-Side Integration Guide for JavaScript {' '} - to implement {PRODUCT_NAME} integration and generate {PRODUCT_NAME} tokens. Secure Signals is updated when the + to implement {IDENTITY_NAME} integration and generate {IDENTITY_NAME} tokens. Secure Signals is updated when the page is reloaded. Reload the page in order to update Secure Signals in local storage.

@@ -354,7 +354,7 @@ const SecureSignalsApp = () => { - {PRODUCT_NAME} Enabled{' '} + {IDENTITY_NAME} Enabled{' '} { - {PRODUCT_NAME} Advertising Token: + {IDENTITY_NAME} Advertising Token:
{advertisingToken}
- Is {PRODUCT_NAME} Login Required? + Is {IDENTITY_NAME} Login Required?
{loginRequired ? 'yes' : 'no'}
- {PRODUCT_NAME} Identity Callback State: + {IDENTITY_NAME} Identity Callback State:
{identityState}
@@ -408,7 +408,7 @@ const SecureSignalsApp = () => { {isOptedOut ? ( <>
-

The email address you entered has opted out of {PRODUCT_NAME}.

+

The email address you entered has opted out of {IDENTITY_NAME}.

@@ -439,7 +439,7 @@ const SecureSignalsApp = () => {
diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index e7e7737a..5bc45a6d 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -41,7 +41,7 @@ docker run -it --rm -p 3000:3000 --env-file .env uid2-secure-signals-server | `UID_CLIENT_SECRET` | Your client secret | Your client secret from UID2/EUID portal | | `SESSION_KEY` | The key to the encryption session data stored in the application's session cookie | Any secure random string | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | -| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | Output similar to the following indicates that the example application is up and running. diff --git a/web-integrations/google-secure-signals/server-side/server.js b/web-integrations/google-secure-signals/server-side/server.js index 57e70ba3..e1f6a4ac 100644 --- a/web-integrations/google-secure-signals/server-side/server.js +++ b/web-integrations/google-secure-signals/server-side/server.js @@ -18,7 +18,7 @@ const uidClientSecret = process.env.UID_CLIENT_SECRET; const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; // UI/Display configuration -const productName = process.env.PRODUCT_NAME || 'UID2'; +const identityName = process.env.IDENTITY_NAME || 'UID2'; const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const ivLength = 12; @@ -188,7 +188,7 @@ app.get('/', protect, (req, res) => { res.render('index', { identity: req.session.identity, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -211,7 +211,7 @@ app.get('/login', async (req, res) => { req.session = null; res.render('login', { secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } @@ -226,7 +226,7 @@ function _GenerateTokenV1(req, res) { if (response.data.status === 'optout') { res.render('optout', { secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (response.data.status !== 'success') { @@ -234,7 +234,7 @@ function _GenerateTokenV1(req, res) { error: 'Got unexpected token generate status: ' + response.data.status, response: response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (typeof response.data.body !== 'object') { @@ -242,7 +242,7 @@ function _GenerateTokenV1(req, res) { error: 'Unexpected token generate response format: ' + response.data, response: response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else { @@ -255,7 +255,7 @@ function _GenerateTokenV1(req, res) { error: error, response: error.response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -283,7 +283,7 @@ app.post('/login', async (req, res) => { if (response.status === 'optout') { res.render('optout', { secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (response.status !== 'success') { @@ -291,7 +291,7 @@ app.post('/login', async (req, res) => { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (typeof response.body !== 'object') { @@ -299,7 +299,7 @@ app.post('/login', async (req, res) => { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else { @@ -311,7 +311,7 @@ app.post('/login', async (req, res) => { error: error, response: error.response, secureSignalsSdkUrl: secureSignalsSdkUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } diff --git a/web-integrations/google-secure-signals/server-side/views/error.html b/web-integrations/google-secure-signals/server-side/views/error.html index 998c57d8..f8b33c1d 100644 --- a/web-integrations/google-secure-signals/server-side/views/error.html +++ b/web-integrations/google-secure-signals/server-side/views/error.html @@ -1,7 +1,7 @@ <%- include('header.html'); -%>

Something went wrong:

<%= error %>
-

Response from the <%- productName %> operator:

+

Response from the <%- identityName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/google-secure-signals/server-side/views/header.html b/web-integrations/google-secure-signals/server-side/views/header.html index 0f954cd4..e2890c2f 100644 --- a/web-integrations/google-secure-signals/server-side/views/header.html +++ b/web-integrations/google-secure-signals/server-side/views/header.html @@ -2,7 +2,7 @@ - Server-Side <%- productName %> Integration Example with Google Secure Signals + Server-Side <%- identityName %> Integration Example with Google Secure Signals @@ -26,18 +26,18 @@ -

Server-Side <%- productName %> Integration Example with Google Secure Signals

+

Server-Side <%- identityName %> Integration Example with Google Secure Signals

- This example demonstrates how a content publisher can use the <%- productName %> services to implement the - server-side <%- productName %> integration workflow with Secure Signals. [ services to implement the + server-side <%- identityName %> integration workflow with Secure Signals. [Source Code]

This assumes that the publisher has implemented - <%- productName %> Server-Side integration - on the backend and is able to pass the resulting <%- productName %> identity response to the front end. + <%- identityName %> Server-Side integration + on the backend and is able to pass the resulting <%- identityName %> identity response to the front end.

diff --git a/web-integrations/google-secure-signals/server-side/views/identity.html b/web-integrations/google-secure-signals/server-side/views/identity.html index 3fe02f2f..dfeca933 100644 --- a/web-integrations/google-secure-signals/server-side/views/identity.html +++ b/web-integrations/google-secure-signals/server-side/views/identity.html @@ -5,6 +5,6 @@ onsubmit="return window.googletag.secureSignalProviders.clearAllCache()" >
- +
diff --git a/web-integrations/google-secure-signals/server-side/views/login.html b/web-integrations/google-secure-signals/server-side/views/login.html index 1a445efc..49d729e0 100644 --- a/web-integrations/google-secure-signals/server-side/views/login.html +++ b/web-integrations/google-secure-signals/server-side/views/login.html @@ -9,6 +9,6 @@ style="border-style: none" /> -
+
<%- include('footer.html'); -%> diff --git a/web-integrations/google-secure-signals/server-side/views/optout.html b/web-integrations/google-secure-signals/server-side/views/optout.html index b8ec18f0..a635c6c0 100644 --- a/web-integrations/google-secure-signals/server-side/views/optout.html +++ b/web-integrations/google-secure-signals/server-side/views/optout.html @@ -3,7 +3,7 @@

This email has opted out

- The email address you entered has opted out of <%- productName %>. No <%- productName %> token can be generated for this + The email address you entered has opted out of <%- identityName %>. No <%- identityName %> token can be generated for this email.

diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index debab37d..becdfd83 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -46,7 +46,7 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| -| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | After you see output similar to the following, the example application is up and running. diff --git a/web-integrations/javascript-sdk/client-server/server.js b/web-integrations/javascript-sdk/client-server/server.js index 0dbca495..9aeed196 100644 --- a/web-integrations/javascript-sdk/client-server/server.js +++ b/web-integrations/javascript-sdk/client-server/server.js @@ -14,7 +14,7 @@ const uidApiKey = process.env.UID_API_KEY; const uidClientSecret = process.env.UID_CLIENT_SECRET; // UI/Display configuration -const productName = process.env.PRODUCT_NAME || 'UID2'; +const identityName = process.env.IDENTITY_NAME || 'UID2'; const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const uidJsSdkUrl = process.env.UID_JS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js'; const uidJsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; @@ -33,7 +33,7 @@ app.set('view engine', 'html'); app.get('/', (req, res) => { res.render('index', { uidBaseUrl: uidBaseUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl, uidJsSdkUrl: uidJsSdkUrl, uidJsSdkName: uidJsSdkName @@ -121,21 +121,21 @@ app.post('/login', async (req, res) => { res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (typeof response.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else { res.render('login', { identity: response.body, uidBaseUrl: uidBaseUrl, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl, uidJsSdkUrl: uidJsSdkUrl, uidJsSdkName: uidJsSdkName @@ -145,7 +145,7 @@ app.post('/login', async (req, res) => { res.render('error', { error: error, response: error.response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } diff --git a/web-integrations/javascript-sdk/client-server/views/error.html b/web-integrations/javascript-sdk/client-server/views/error.html index 098bd957..450b4bb5 100644 --- a/web-integrations/javascript-sdk/client-server/views/error.html +++ b/web-integrations/javascript-sdk/client-server/views/error.html @@ -2,7 +2,7 @@ - Error - Client-Server <%- productName %> Integration Example using JavaScript SDK + Error - Client-Server <%- identityName %> Integration Example using JavaScript SDK @@ -10,7 +10,7 @@ <%- include('intro.html'); -%>

Something went wrong:

<%= error %>
-

Response from the <%- productName %> operator:

+

Response from the <%- identityName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/javascript-sdk/client-server/views/index.html b/web-integrations/javascript-sdk/client-server/views/index.html index b0f836cd..7a11d60e 100644 --- a/web-integrations/javascript-sdk/client-server/views/index.html +++ b/web-integrations/javascript-sdk/client-server/views/index.html @@ -2,7 +2,7 @@ - Client-Server <%- productName %> Integration Example using JavaScript SDK + Client-Server <%- identityName %> Integration Example using JavaScript SDK @@ -62,19 +62,19 @@

       
       
-        <%- productName %> Advertising Token:
+        <%- identityName %> Advertising Token:
         

       
       
-        Is <%- productName %> Login Required?
+        Is <%- identityName %> Login Required?
         

       
       
-        <%- productName %> Identity Updated Counter:
+        <%- identityName %> Identity Updated Counter:
         

       
       
-        <%- productName %> Identity Callback State:
+        <%- identityName %> Identity Callback State:
         

       
     
@@ -89,12 +89,12 @@
             style="border-style: none"
           />
         
-        
+
diff --git a/web-integrations/javascript-sdk/client-server/views/intro.html b/web-integrations/javascript-sdk/client-server/views/intro.html index bbb88016..064d476f 100644 --- a/web-integrations/javascript-sdk/client-server/views/intro.html +++ b/web-integrations/javascript-sdk/client-server/views/intro.html @@ -1,12 +1,12 @@ -

Client-Server <%- productName %> Integration Example using JavaScript SDK

+

Client-Server <%- identityName %> Integration Example using JavaScript SDK

- This example demonstrates how a content publisher can use the <%- productName %> services and the + This example demonstrates how a content publisher can use the <%- identityName %> services and the <%- productName %> SDK for JavaScript<%- identityName %> SDK for JavaScript - (<%- productName %> SDK) to implement the + (<%- identityName %> SDK) to implement the client-server <%- productName %> integration workflowclient-server <%- identityName %> integration workflow. [Source Code] diff --git a/web-integrations/javascript-sdk/client-server/views/login.html b/web-integrations/javascript-sdk/client-server/views/login.html index f62d14b8..749aa5c3 100644 --- a/web-integrations/javascript-sdk/client-server/views/login.html +++ b/web-integrations/javascript-sdk/client-server/views/login.html @@ -2,7 +2,7 @@ - Login - Client-Server <%- productName %> Integration Example using JavaScript SDK + Login - Client-Server <%- identityName %> Integration Example using JavaScript SDK @@ -22,12 +22,12 @@ <%- include('intro.html'); -%> -

Generate <%- productName %> completed

-

<%- productName %> identity:

+

Generate <%- identityName %> completed

+

<%- identityName %> identity:

<%- JSON.stringify(identity, null, 2) %>

Back to the main page

- Normally user would be redirected automatically, but this example demonstrates one way <%- productName %> + Normally user would be redirected automatically, but this example demonstrates one way <%- identityName %> generation could be handled.

diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 662144fb..340da29b 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -50,7 +50,7 @@ The application uses environment variables from the `.env` file in the base dire | Variable | Description | Example Values | |:---------|:------------|:---------------| -| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | ## Accessing the Application diff --git a/web-integrations/javascript-sdk/client-side/entrypoint.sh b/web-integrations/javascript-sdk/client-side/entrypoint.sh index e171a25f..ab859464 100644 --- a/web-integrations/javascript-sdk/client-side/entrypoint.sh +++ b/web-integrations/javascript-sdk/client-side/entrypoint.sh @@ -7,7 +7,7 @@ export UID_JS_SDK_NAME=${UID_JS_SDK_NAME:-"__uid2"} export UID_BASE_URL=${UID_CLIENT_BASE_URL:-${UID_BASE_URL:-"https://operator-integ.uidapi.com"}} export SERVER_PUBLIC_KEY=${UID_CSTG_SERVER_PUBLIC_KEY:-"UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="} export SUBSCRIPTION_ID=${UID_CSTG_SUBSCRIPTION_ID:-"DMr7uHxqLU"} -export PRODUCT_NAME=${PRODUCT_NAME:-"UID2"} +export IDENTITY_NAME=${IDENTITY_NAME:-"UID2"} export DOCS_BASE_URL=${DOCS_BASE_URL:-"https://unifiedid.com/docs"} # Process index.html template with environment variables diff --git a/web-integrations/javascript-sdk/client-side/html/iframe.html b/web-integrations/javascript-sdk/client-side/html/iframe.html index 7e985dc8..fab1c21a 100644 --- a/web-integrations/javascript-sdk/client-side/html/iframe.html +++ b/web-integrations/javascript-sdk/client-side/html/iframe.html @@ -2,7 +2,7 @@ - Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK + Client-Side ${IDENTITY_NAME} Integration Example using JavaScript SDK diff --git a/web-integrations/javascript-sdk/client-side/html/index.html b/web-integrations/javascript-sdk/client-side/html/index.html index 2e38abb8..8ad76e04 100644 --- a/web-integrations/javascript-sdk/client-side/html/index.html +++ b/web-integrations/javascript-sdk/client-side/html/index.html @@ -2,7 +2,7 @@ - Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK + Client-Side ${IDENTITY_NAME} Integration Example using JavaScript SDK @@ -89,13 +89,13 @@ -

Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK

+

Client-Side ${IDENTITY_NAME} Integration Example using JavaScript SDK

This example demonstrates how a content publisher can follow the Client-Side Integration Guide for JavaScript - to implement ${PRODUCT_NAME} integration and generate ${PRODUCT_NAME} tokens. + to implement ${IDENTITY_NAME} integration and generate ${IDENTITY_NAME} tokens. Note: This is a test-only integration environment—not for production use. It does not perform real user authentication or generate production-level tokens. Do not use real user data on this page. @@ -136,11 +136,11 @@

Client-Side ${PRODUCT_NAME} Integration Example using JavaScript SDK

style="border-style: none" /> -
>
+
>
diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 6794a27e..3fa2415e 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -58,7 +58,7 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| -| `PRODUCT_NAME` | Product name for UI display | UID2: `UID2`
EUID: `EUID` | +| `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | After you see output similar to the following, the example application is up and running. diff --git a/web-integrations/server-side/server.js b/web-integrations/server-side/server.js index 0cb30f48..f6efcaa7 100644 --- a/web-integrations/server-side/server.js +++ b/web-integrations/server-side/server.js @@ -15,7 +15,7 @@ const uidApiKey = process.env.UID_API_KEY; const uidClientSecret = process.env.UID_CLIENT_SECRET; // UI/Display configuration -const productName = process.env.PRODUCT_NAME || 'UID2'; +const identityName = process.env.IDENTITY_NAME || 'UID2'; const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; const ivLength = 12; @@ -169,7 +169,7 @@ async function protect(req, res, next){ app.get('/', protect, (req, res) => { res.render('index', { identity: req.session.identity, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -177,7 +177,7 @@ app.get('/content1', protect, (req, res) => { res.render('content', { identity: req.session.identity, content: 'First Sample Content', - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -185,7 +185,7 @@ app.get('/content2', protect, (req, res) => { res.render('content', { identity: req.session.identity, content: 'Second Sample Content', - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -195,7 +195,7 @@ app.get('/login', async (req, res) => { } else { req.session = null; res.render('login', { - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } @@ -209,14 +209,14 @@ function _GenerateTokenV1(req, res) { res.render('error', { error: 'Got unexpected token generate status: ' + response.data.status, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (typeof response.data.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format: ' + response.data, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else { @@ -228,7 +228,7 @@ function _GenerateTokenV1(req, res) { res.render('error', { error: error, response: error.response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); }); @@ -253,14 +253,14 @@ app.post('/login', async (req, res) => { res.render('error', { error: 'Got unexpected token generate status in decrypted response: ' + response.status, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else if (typeof response.body !== 'object') { res.render('error', { error: 'Unexpected token generate response format in decrypted response: ' + response, response: response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } else { @@ -271,7 +271,7 @@ app.post('/login', async (req, res) => { res.render('error', { error: error, response: error.response, - productName: productName, + identityName: identityName, docsBaseUrl: docsBaseUrl }); } diff --git a/web-integrations/server-side/views/content.html b/web-integrations/server-side/views/content.html index 95fcdb94..710c7e02 100644 --- a/web-integrations/server-side/views/content.html +++ b/web-integrations/server-side/views/content.html @@ -1,5 +1,5 @@ <%- include('header.html'); -%> -

Protected Content — accessible only with a valid <%- productName %> identity:

+

Protected Content — accessible only with a valid <%- identityName %> identity:

<%= content %>

Back to the main page

<%- include('identity.html'); -%> diff --git a/web-integrations/server-side/views/error.html b/web-integrations/server-side/views/error.html index 998c57d8..f8b33c1d 100644 --- a/web-integrations/server-side/views/error.html +++ b/web-integrations/server-side/views/error.html @@ -1,7 +1,7 @@ <%- include('header.html'); -%>

Something went wrong:

<%= error %>
-

Response from the <%- productName %> operator:

+

Response from the <%- identityName %> operator:

<%= response ? JSON.stringify(response.data) : '' %>

HTTP error:

<%= response ? (response.status + ' ' + response.statusText) : '' %>
diff --git a/web-integrations/server-side/views/header.html b/web-integrations/server-side/views/header.html index 27790f39..f436e9a0 100644 --- a/web-integrations/server-side/views/header.html +++ b/web-integrations/server-side/views/header.html @@ -2,12 +2,12 @@ - Server-Side <%- productName %> Integration Example + Server-Side <%- identityName %> Integration Example -

Server-Side <%- productName %> Integration Example

-

This example demonstrates how a content publisher can use <%- productName %> services to implement the - server-side <%- productName %> integration workflow. +

Server-Side <%- identityName %> Integration Example

+

This example demonstrates how a content publisher can use <%- identityName %> services to implement the + server-side <%- identityName %> integration workflow. [Source Code]

diff --git a/web-integrations/server-side/views/index.html b/web-integrations/server-side/views/index.html index 9d34edce..2b2b47b7 100644 --- a/web-integrations/server-side/views/index.html +++ b/web-integrations/server-side/views/index.html @@ -1,9 +1,9 @@ <%- include('header.html'); -%> -

Protected Content — accessible only with a valid <%- productName %> identity:

+

Protected Content — accessible only with a valid <%- identityName %> identity:

-

Current <%- productName %> Identity:

+

Current <%- identityName %> Identity:

<%- include('identity.html'); -%> <%- include('footer.html'); -%> From e91e25990678da526d5689eb13c24a1dd2ba0644 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 13:02:40 -0600 Subject: [PATCH 13/39] Remove ui default values and remove unnecessary sdk defintions --- .../google-secure-signals/client-server/server.js | 4 ++-- .../google-secure-signals/client-server/views/index.html | 6 +++--- .../google-secure-signals/client-server/views/login.html | 8 ++++---- .../react-client-side/src/SecureSignalsApp.tsx | 4 ++-- .../google-secure-signals/server-side/server.js | 4 ++-- web-integrations/javascript-sdk/client-server/server.js | 4 ++-- web-integrations/server-side/server.js | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/server.js b/web-integrations/google-secure-signals/client-server/server.js index 3cad1f9f..51f8f225 100644 --- a/web-integrations/google-secure-signals/client-server/server.js +++ b/web-integrations/google-secure-signals/client-server/server.js @@ -21,8 +21,8 @@ const uidJsSdkName = process.env.UID_JS_SDK_NAME || '__uid2'; const secureSignalsSdkUrl = process.env.UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; // UI/Display configuration -const identityName = process.env.IDENTITY_NAME || 'UID2'; -const docsBaseUrl = process.env.DOCS_BASE_URL || 'https://unifiedid.com/docs'; +const identityName = process.env.IDENTITY_NAME; +const docsBaseUrl = process.env.DOCS_BASE_URL; const ivLength = 12; const nonceLength = 8; diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 06281c82..2c136405 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -53,8 +53,8 @@ window.googletag.secureSignalProviders.clearAllCache(); updateGuiElements(undefined); }); - window[sdkName] = window[sdkName] || { callbacks: [] }; - window[sdkName].callbacks.push((eventType, payload) => { + sdk.callbacks = sdk.callbacks || []; + sdk.callbacks.push((eventType, payload) => { if (eventType === "SdkLoaded") { sdk.init({ baseUrl: "<%- uidBaseUrl %>", @@ -62,7 +62,7 @@ }); } }); - window[sdkName].callbacks.push(onUid2IdentityUpdated); + sdk.callbacks.push(onUid2IdentityUpdated); }); diff --git a/web-integrations/google-secure-signals/client-server/views/login.html b/web-integrations/google-secure-signals/client-server/views/login.html index a02a31c4..d50e2527 100644 --- a/web-integrations/google-secure-signals/client-server/views/login.html +++ b/web-integrations/google-secure-signals/client-server/views/login.html @@ -11,10 +11,10 @@ From 8a17e06af7bf21c9c7f75f04245cae51e74183dd Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 14:56:22 -0600 Subject: [PATCH 18/39] add additonal euid referencees in testing application section in readmes --- .../client-server/README.md | 14 +++++++------ .../client-side/README.md | 2 ++ .../react-client-side/README.md | 20 +++++++++++-------- .../server-side/README.md | 14 +++++++------ .../javascript-sdk/client-server/README.md | 16 ++++++++------- web-integrations/server-side/README.md | 18 +++++++++-------- 6 files changed, 49 insertions(+), 35 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index eda2bcbe..e8f46db2 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -82,14 +82,16 @@ If needed, to close the application, terminate the Docker container or use the ` ## Test the Example Application +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. + The following table outlines and annotates the steps you can take to test and explore the example application. | Step | Description | Comments | | :--: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1 | In your browser, navigate to the application main page at `http://localhost:3052`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the email address that you want to use for testing and click **Generate UID2**. Note: The button may be labeled different here as it is a testing environment; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) endpoint and processes the received response. | -| | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `POST /token/generate` response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the UID2 SDK [`init()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party UID2 cookie (see [UID2 Storage Format](https://unifiedid.com/docs/sdks/sdk-ref-javascript#uid2-storage-format) for use on subsequent page loads. | -| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value and a video player. While the [page view](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page view](views/index.html) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3052`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | +| 2 | In the text field at the bottom, enter the email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint (see [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) for UID2 or [POST /token/generate](https://euid.eu/docs/endpoints/post-token-generate#decrypted-json-response-format) for EUID) and processes the received response. | +| | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the POST /token/generate response (see [Decrypted JSON Response Format](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) for UID2 or [Decrypted JSON Response Format](https://euid.eu/docs/endpoints/post-token-generate#decrypted-json-response-format) for EUID). It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the SDK [`init()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party cookie for use on subsequent page loads. | +| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value and a video player. While the [page view](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page view](views/index.html) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | | 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | -| 5 | Keep the application main page open, or refresh it after a while, and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up to date, and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked, and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow Overview](https://unifiedid.com/docs/sdks/sdk-ref-javascript#workflow-overview) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/sdk-ref-javascript#background-token-auto-refresh). | -| 6 | To exit the application, click **Clear UID2**. | This event calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | +| 5 | Keep the application main page open, or refresh it after a while, and note the identity state, updated counter, and login information values. | In the background, the SDK continuously validates whether the advertising token is up to date, and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked, and the UI elements are updated with the current state of the identity. For details, see [Workflow Overview](https://unifiedid.com/docs/sdks/sdk-ref-javascript#workflow-overview) (UID2) or [Workflow Overview](https://euid.eu/docs/sdks/sdk-ref-javascript#workflow-overview) (EUID), and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/sdk-ref-javascript#background-token-auto-refresh). | +| 6 | To exit the application, click **Clear UID2** or **Clear EUID**. | This event calls the SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the session and the first-party cookie and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index 3fe53f80..cf5be481 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -53,6 +53,8 @@ The example application illustrates the steps documented in the Google Ad Manage - UID2: [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript) - EUID: [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript) +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. + The following table outlines and annotates the steps you may take to test and explore the example application. | Step | Description | Comments | diff --git a/web-integrations/google-secure-signals/react-client-side/README.md b/web-integrations/google-secure-signals/react-client-side/README.md index 026e4eec..f6c36505 100644 --- a/web-integrations/google-secure-signals/react-client-side/README.md +++ b/web-integrations/google-secure-signals/react-client-side/README.md @@ -45,17 +45,21 @@ If needed, to close the application, terminate the docker container or use the ` ## Test the Example Application -The example application illustrates the steps documented in the [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss). For an overview of the high-level workflow for establishing UID2 identity, API reference, and explanation of the UID2 cookie format, see [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/client-side-identity). +The example application illustrates the steps documented in the Google Ad Manager Secure Signals Integration guides: +- UID2: [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/client-side-identity) +- EUID: [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/client-side-identity) + +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. The following table outlines and annotates the steps you may take to test and explore the example application. | Step | Description | Comments | | :--: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | In your browser, navigate to the application main page at `http://localhost:3044`. | The displayed main [page](src/SecureSignalsApp.tsx) of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2**. Note: The button may be labeled different here as it is a testing environment; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JS SDK ([Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript)). | -| 3 | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `client-generate` response. Next, the identity information is passed to the UID2 SDK [`setIdentity()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#setidentityidentity-identity-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party UID2 cookie (see [UID2 Storage Format](https://unifiedid.com/docs/sdks/sdk-ref-javascript#uid2-storage-format) for use on subsequent page loads.) | -| 4 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value and a video player. While the [page](src/SecureSignalsApp.tsx) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page](src/SecureSignalsApp.tsx) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie or local storage. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3044`. | The displayed main [page](src/SecureSignalsApp.tsx) of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JavaScript SDK. | +| 3 | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the `client-generate` response. Next, the identity information is passed to the SDK `setIdentity()` function. If the identity is valid, the SDK stores it either in local storage or a first-party cookie for use on subsequent page loads. | +| 4 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value and a video player. While the [page](src/SecureSignalsApp.tsx) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page](src/SecureSignalsApp.tsx) calls the init() function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie or local storage. | | 5 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | -| 6 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | -| 7 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | -| 8 | To exit the application, click **Clear UID2**. | This event calls the UID2 SDK [`disconnect()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#disconnect-void) function, which clears the UID2 session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the UID2 SDK [`isLoginRequired()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#isloginrequired-boolean) function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | +| 6 | (Optional) Right-click the main page to inspect the source code. | When the SDK initialization is complete, the SDK invokes the passed callback function.
IMPORTANT: The callback updates the page elements with the state of the identity: this is the place where you should define your logic for initiating targeted advertising. | +| 7 | Keep the application main page open or refresh it after awhile and note the identity state, updated counter, and login information values. | In the background, the SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the identity. | +| 8 | To exit the application, click **Clear UID2** or **Clear EUID**. | This event calls the SDK `disconnect()` function, which clears the session and the first-party cookie or local storage and calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function to clear all cached signals. This call also makes the SDK `isLoginRequired()` function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 0c74357a..1446f919 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -67,14 +67,16 @@ Access to these pages is possible only after the user completes the login proces Submitting the login form simulates logging in to a publisher's application in the real world. Normally, the login would require checking the user's secure credentials (for example, a password). In this example, for demonstration purposes, this -step is omitted, and the login process focuses on integration with the UID2 services instead. +step is omitted, and the login process focuses on integration with the UID2/EUID services instead. + +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. The following table outlines and annotates the steps you can take to test and explore the example application. | Step | Description | Comments | | :--: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | -| 2 | Enter the email address that you want to use for testing and click **Generate UID2**. Note: The button may be labeled different here as it is a testing environment; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | -| | The main page updates to display the established UID2 identity information and a video player. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the successful `POST /token/generate` response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. While the main page is loading, [Google Publisher Tag (GPT)](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal UID2 script which pushes the advertising token to GPT local storage. The [Interactive Media Ads (IMA) SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) then makes an ad request, and transmits the encoded signal in the request. | -| 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll.ad. | -| 5 | To exit the application, click **Clear UID2**. | This event calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals, and then calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the UID2 session and the first-party cookie and presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | +| 2 | Enter the email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint and processes the received response. | +| | The main page updates to display the established identity information and a video player. | The displayed identity information is the `body` property of the JSON response payload from the successful POST /token/generate response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. While the main page is loading, [Google Publisher Tag (GPT)](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage. The [Interactive Media Ads (IMA) SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) then makes an ad request, and transmits the encoded signal in the request. | +| 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | +| 5 | To exit the application, click **Clear UID2** or **Clear EUID**. | This event calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals, and then calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the session and the first-party cookie and presents the user with the login form again.
NOTE: The page displays the **Clear** button as long as the user identity is valid and refreshable within the integration test environment. | diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 64988c5d..3531bc8c 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -66,14 +66,16 @@ The example application illustrates the steps documented in the integration guid - UID2: [UID2 SDK Integration Guide](https://unifiedid.com/docs/guides/publisher-client-side), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/client-side-identity) - EUID: [EUID SDK Integration Guide](https://euid.eu/docs/guides/publisher-client-side), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/client-side-identity) +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. + The following table outlines and annotates the steps you may take to test and explore the example application. | Step | Description | Comments | | :--: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2**. Note: The button may be labeled different here as it is a testing environment; in a real production environment, labels may differ. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | -| | A confirmation message appears with the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the `POST /token/generate` response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the [UID2 SDK `init()` function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void). If the identity is valid, the SDK stores it in a [first-party UID2 cookie](https://unifiedid.com/docs/sdks/client-side-identity#uid2-cookie-format) for use on subsequent page loads. | -| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **UID2 Advertising Token** value. The [page view](views/index.html) calls the [init() function](https://unifiedid.com/docs/sdks/client-side-identity#initopts-object-void) again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | -| 4 | (Optional) Right-click the main page to inspect the source code. | When the UID2 SDK initialization is complete, the SDK invokes the passed [callback function](https://unifiedid.com/docs/sdks/client-side-identity#callback-function) (`onUid2IdentityUpdated()` in this example).
IMPORTANT: The callback updates the page elements with the state of UID2 identity: this is the place where you should define your logic for initiating targeted advertising. | -| 5 | Keep the application main page open or refresh it after awhile and note the UID2 identity state, updated counter, and login information values. | In the background, the UID2 SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the UID2 identity. For details, see [Workflow States and Transitions](https://unifiedid.com/docs/sdks/client-side-identity#workflow-states-and-transitions) and [Background Token Auto-Refresh](https://unifiedid.com/docs/sdks/client-side-identity#background-token-auto-refresh). | -| 6 | To exit the application, click **Clear UID2**. | This event calls the [UID2 SDK `disconnect()` function](https://unifiedid.com/docs/sdks/client-side-identity#disconnect-void), which clears the UID2 session and the first-party cookie. This call also makes the [UID2 SDK `isLoginRequired()` function](https://unifiedid.com/docs/sdks/client-side-identity#isloginrequired-boolean) return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear UID2** button as long as the user identity is valid and refreshable within the integration test environment. | \ No newline at end of file +| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint and processes the received response. | +| | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the POST /token/generate response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the SDK `init()` function. If the identity is valid, the SDK stores it in a first-party cookie for use on subsequent page loads. | +| 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value. The [page view](views/index.html) calls the init() function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | +| 4 | (Optional) Right-click the main page to inspect the source code. | When the SDK initialization is complete, the SDK invokes the passed callback function.
IMPORTANT: The callback updates the page elements with the state of the identity: this is the place where you should define your logic for initiating targeted advertising. | +| 5 | Keep the application main page open or refresh it after awhile and note the identity state, updated counter, and login information values. | In the background, the SDK continuously validates whether the advertising token is up-to-date and refreshes it automatically when needed. If the refresh succeeds, the user opts out, or the refresh token expires, the callback function is invoked and the UI elements are updated with the current state of the identity. | +| 6 | To exit the application, click **Clear UID2** or **Clear EUID**. | This event calls the SDK `disconnect()` function, which clears the session and the first-party cookie. This call also makes the SDK `isLoginRequired()` function return `true`, which presents the user with the login form again.
NOTE: The page displays the **Clear** button as long as the user identity is valid and refreshable within the integration test environment. | \ No newline at end of file diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 1735c1c2..8aa1578a 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -75,8 +75,10 @@ If needed, to close the application, terminate the docker container or use the ` ## Test the Example Application The example application illustrates the steps documented in the server-side integration guides: -- UID2: [Server-Side UID2 Integration Guide](https://unifiedid.com/docs/guides/custom-publisher-integration) -- EUID: [Server-Side EUID Integration Guide](https://euid.eu/docs/guides/custom-publisher-integration) +- UID2: [Server-Side Integration Guide](https://unifiedid.com/docs/guides/integration-publisher-server-side) +- EUID: [Server-Side Integration Guide](https://euid.eu/docs/guides/integration-publisher-server-side) + +**Note:** For API endpoint documentation, see the UID2 or EUID docs based on your configuration. The application provides three main pages: index (main), example content 1, and example content 2. Access to these pages is possible only after the user completes the login process. If the user is not logged in, they will be redirected to the login page. @@ -88,9 +90,9 @@ The following table outlines and annotates the steps you may take to test and ex | Step | Description | Comments | |:----:|:------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 1 | In your browser, navigate to the application main page at `http://localhost:3033`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2 login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | -| 2 | Enter the user email address that you want to use for testing and click **Log In**. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate) endpoint and processes the received response. | -| | The main page is updated to display links to the two pages with protected content and the established UID2 identity information. | The displayed identity information is the `body` property of the [JSON response payload](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) from the successful `POST /token/generate` response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. | -| 3 | Click either of the two sample content pages. | When the user requests the index or content pages, the server reads the user session and extracts the current UID2 identity ([server.js](server.js)). The `advertising_token` on the identity can be used for targeted advertising. | -| 4 | Click the **Back to the main page** link. | Note that the identity contains several timestamps that determine when the advertising token becomes invalid (`identity_expires`) and when the server should attempt to refresh it (`refresh_from`). Every time a protected page is requested, the `verifyIdentity` function ([server.js](server.js)) calls [POST /token/refresh](https://unifiedid.com/docs/endpoints/post-token-refresh) as needed.
The user is automatically logged out in the following cases:
- If the identity expires without being refreshed and refresh attempt fails.
- If the refresh token expires.
- If the refresh attempt indicates that the user has opted out. | -| 5 | To exit the application, click **Log Out**. | This calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the UID2 session and the first-party cookie and presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user is logged it. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3033`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 2 | Enter the user email address that you want to use for testing and click **Log In**. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint and processes the received response. | +| | The main page is updated to display links to the two pages with protected content and the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the successful POST /token/generate response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. | +| 3 | Click either of the two sample content pages. | When the user requests the index or content pages, the server reads the user session and extracts the current identity ([server.js](server.js)). The `advertising_token` on the identity can be used for targeted advertising. | +| 4 | Click the **Back to the main page** link. | Note that the identity contains several timestamps that determine when the advertising token becomes invalid (`identity_expires`) and when the server should attempt to refresh it (`refresh_from`). Every time a protected page is requested, the `verifyIdentity` function ([server.js](server.js)) calls POST /token/refresh as needed.
The user is automatically logged out in the following cases:
- If the identity expires without being refreshed and refresh attempt fails.
- If the refresh token expires.
- If the refresh attempt indicates that the user has opted out. | +| 5 | To exit the application, click **Log Out**. | This calls the `/logout` endpoint on the server ([server.js](server.js)), which clears the session and the first-party cookie and presents the user with the login form again.
NOTE: The page displays the **Log Out** button as long as the user is logged in. | From 55f3067d6c044ec01a4c7fd2f6100f9c267e65ea Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 15:02:25 -0600 Subject: [PATCH 19/39] update readmes to clarify distinction between uid2 and euid in titles --- .../google-secure-signals/client-server/README.md | 8 +++++--- .../google-secure-signals/client-side/README.md | 6 ++++-- .../google-secure-signals/react-client-side/README.md | 9 +++++++-- .../google-secure-signals/server-side/README.md | 8 +++++--- web-integrations/javascript-sdk/client-server/README.md | 8 +++++--- web-integrations/javascript-sdk/client-side/README.md | 9 +++++++-- web-integrations/server-side/README.md | 8 +++++--- 7 files changed, 38 insertions(+), 18 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index e8f46db2..a4b41bd0 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -1,11 +1,13 @@ -# Client-Server UID2/EUID SDK Integration Example with Google Secure Signals +# Client-Server UID2 or EUID SDK Integration Example with Google Secure Signals -This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and the UID2/EUID SDK for JavaScript to share UID2 or EUID tokens directly with bidders, in an implementation that uses this SDK. +This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and either the UID2 or EUID SDK for JavaScript to share tokens directly with bidders, in a client-server implementation that uses this SDK. - For UID2: [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss#sdk-for-javascript-client-server-integration) - For EUID: [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript), [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss#sdk-for-javascript-client-server-integration) -For an example application without using the SDK, see [Server-Side UID2/EUID Integration Example with Google Secure Signals](../server-side/README.md). +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. + +For an example application without using the SDK, see [Server-Side UID2 or EUID Integration Example with Google Secure Signals](../server-side/README.md). > NOTE: Although the server side of the example application is implemented in JavaScript using node.js, it is not a requirement. You can use any technology of your choice and refer to the example application for an illustration of the functionality that needs to be implemented. diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index cf5be481..dff57079 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -1,10 +1,12 @@ -# Client-Side UID2/EUID SDK Integration Example with Google Secure Signals +# Client-Side UID2 or EUID SDK Integration Example with Google Secure Signals -This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and the UID2/EUID SDK for JavaScript to share UID2 or EUID tokens directly with bidders, in an implementation that uses this SDK on the client side. +This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and either the UID2 or EUID SDK for JavaScript to share tokens directly with bidders, in a client-side implementation that uses this SDK. - For UID2: [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss) - For EUID: [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript), [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss) +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. + ## Build and Run the Example Application ### Environment Configuration diff --git a/web-integrations/google-secure-signals/react-client-side/README.md b/web-integrations/google-secure-signals/react-client-side/README.md index f6c36505..dd464aa2 100644 --- a/web-integrations/google-secure-signals/react-client-side/README.md +++ b/web-integrations/google-secure-signals/react-client-side/README.md @@ -1,6 +1,11 @@ -# React Client-Side UID2 SDK Integration Example with Google Secure Signals +# React Client-Side UID2 or EUID SDK Integration Example with Google Secure Signals -This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and the [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript) to share UID2 directly with bidders, in an implementation that uses this JS SDK on the client side in a React App. +This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) and either the UID2 or EUID SDK for JavaScript to share tokens directly with bidders, in a client-side React implementation that uses this SDK. + +- For UID2: [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss) +- For EUID: [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript), [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss) + +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. ## Build and Run the Example Application diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 1446f919..59f86ea2 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -1,11 +1,13 @@ -# Server-Side UID2/EUID Integration Example with Google Secure Signals +# Server-Side UID2 or EUID Integration Example with Google Secure Signals -This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) to share UID2 or EUID tokens directly with bidders, in a server-side implementation without using an SDK. +This example demonstrates how a content publisher who is working with [Google Interactive Media Ads(IMA) SDKs](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) can use [Google Secure Signal](https://support.google.com/admanager/answer/10488752) with either UID2 or EUID to share tokens directly with bidders, in a server-side implementation without using an SDK. - For UID2: [Google Ad Manager Secure Signals Integration Guide](https://unifiedid.com/docs/guides/integration-google-ss#server-side-integration) - For EUID: [EUID Google Ad Manager Secure Signals Integration Guide](https://euid.eu/docs/guides/integration-google-ss#server-side-integration) -For an example application using the SDK, see [Client-Server UID2/EUID SDK Integration Example with Google Secure Signals](../client-server/README.md) or [Client-Side UID2/EUID SDK Integration Example with Google Secure Signals](../client-side/README.md). +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. + +For an example application using the SDK, see [Client-Server UID2 or EUID SDK Integration Example with Google Secure Signals](../client-server/README.md) or [Client-Side UID2 or EUID SDK Integration Example with Google Secure Signals](../client-side/README.md). > NOTE: Although the server side of the example application is implemented in JavaScript using node.js, it is not a requirement. You can use any technology of your choice and refer to the example application for an illustration of the functionality that needs to be implemented. diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 3531bc8c..502ac2c5 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -1,11 +1,13 @@ -# Client-Server UID2/EUID Integration Example using JavaScript SDK +# Client-Server UID2 or EUID Integration Example using JavaScript SDK -[This example](https://example-jssdk-integ.uidapi.com/) demonstrates how a content publisher can use the UID2/EUID services and the UID2/EUID SDK for JavaScript to implement the client-server UID2/EUID integration workflow. +[This example](https://example-jssdk-integ.uidapi.com/) demonstrates how a content publisher can use either the UID2 or EUID services and the corresponding SDK for JavaScript to implement the client-server integration workflow. - For UID2: [UID2 services](https://unifiedid.com/docs/intro), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript), [client-server UID2 integration workflow](https://unifiedid.com/docs/guides/integration-javascript-client-server) - For EUID: [EUID services](https://euid.eu/docs/intro), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript), [client-server EUID integration workflow](https://euid.eu/docs/guides/integration-javascript-client-server) -For an example application without using the SDK, see [Server-Side UID2 Integration Example](../../server-side/README.md). +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. + +For an example application without using the SDK, see [Server-Side UID2 or EUID Integration Example](../../server-side/README.md). > NOTE: While the server side of the example application is implemented in JavaScript using node.js, it is not > a requirement. You can use any technology of your choice and refer to the example application for illustration of the functionality that needs to be implemented. diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 3743ed5a..c555d5da 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -1,6 +1,11 @@ -# Client-Side UID2/EUID Integration Example using JavaScript SDK +# Client-Side UID2 or EUID Integration Example using JavaScript SDK -This example demonstrates how a content publisher can follow the [Client-Side Integration Guide for JavaScript](https://unifiedid.com/docs/guides/integration-javascript-client-side) (UID2) or [EUID Client-Side Integration Guide for JavaScript](https://euid.eu/docs/guides/integration-javascript-client-side) (EUID) to implement UID2/EUID integration and generate UID2/EUID tokens. +This example demonstrates how a content publisher can follow the Client-Side Integration Guide for JavaScript to implement either a UID2 or EUID integration and generate tokens on the client side. + +- For UID2: [Client-Side Integration Guide for JavaScript](https://unifiedid.com/docs/guides/integration-javascript-client-side), [UID2 SDK for JavaScript](https://unifiedid.com/docs/sdks/sdk-ref-javascript) +- For EUID: [EUID Client-Side Integration Guide for JavaScript](https://euid.eu/docs/guides/integration-javascript-client-side), [EUID SDK for JavaScript](https://euid.eu/docs/sdks/sdk-ref-javascript) + +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. ## Running with Docker diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 8aa1578a..fd1be96c 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -1,11 +1,13 @@ -# Server-Side UID2/EUID Integration Example +# Server-Side UID2 or EUID Integration Example -[This example](https://example-srvonly-integ.uidapi.com/) demonstrates how a content publisher can use the UID2/EUID services to implement the server-side UID2/EUID integration workflow without using an SDK. +[This example](https://example-srvonly-integ.uidapi.com/) demonstrates how a content publisher can use either the UID2 or EUID services to implement the server-side integration workflow without using an SDK. - For UID2: [UID2 services](https://unifiedid.com/docs/intro), [server-side UID2 integration workflow](https://unifiedid.com/docs/guides/integration-publisher-server-side) - For EUID: [EUID services](https://euid.eu/docs/intro), [server-side EUID integration workflow](https://euid.eu/docs/guides/integration-publisher-server-side) -For an example application using the SDK, see [Client-Server UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-server/README.md) or [Client-Side UID2 Integration Example using JavaScript SDK](../javascript-sdk/client-side/README.md). +This example supports both UID2 and EUID environments — the behavior depends on your configured environment variables. + +For an example application using the SDK, see [Client-Server UID2 or EUID Integration Example using JavaScript SDK](../javascript-sdk/client-server/README.md) or [Client-Side UID2 or EUID Integration Example using JavaScript SDK](../javascript-sdk/client-side/README.md). >NOTE: While the server side of the example application is implemented in JavaScript using node.js, it is not a requirement. You can use any technology of your choice and refer to the example application for illustration of the functionality that needs to be implemented. From 22fc266c589ecbba8e06ad44c735f70839e745fb Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 15:23:41 -0600 Subject: [PATCH 20/39] update function names with uid2 and fix back to home page bug in gss client server --- .../client-server/views/index.html | 4 ++-- .../client-side/html/scripts/scripts.js | 16 +++----------- .../src/SecureSignalsApp.tsx | 21 +++++++++++-------- .../client-server/views/index.html | 4 ++-- .../client-server/views/login.html | 4 ++-- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 2c136405..e6138b3d 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -34,7 +34,7 @@ } } - function onUid2IdentityUpdated(eventType, payload) { + function onIdentityUpdated(eventType, payload) { if ( payload?.identity && (eventType === "InitCompleted" || eventType === "IdentityUpdated") @@ -62,7 +62,7 @@ }); } }); - sdk.callbacks.push(onUid2IdentityUpdated); + sdk.callbacks.push(onIdentityUpdated); }); diff --git a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js index ed04f785..6c6b7d77 100644 --- a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js +++ b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js @@ -89,26 +89,16 @@ function onDocumentReady() { }); } -window[sdkName] = window[sdkName] || {}; -window[sdkName].callbacks = window[sdkName].callbacks || []; +sdk.callbacks = sdk.callbacks || []; -window[sdkName].callbacks.push(onIdentityUpdated); -window[sdkName].callbacks.push((eventType, payload) => { +sdk.callbacks.push(onIdentityUpdated); +sdk.callbacks.push((eventType, payload) => { if (eventType === 'SdkLoaded') { sdk.init({ baseUrl: '${UID_BASE_URL}', }); $(document).ready(() => { - // Clear any existing identity on page load for clean state - sdk.disconnect(); - loginAttempted = false; - onDocumentReady(); - // Always show login form on initial page load - $('#login_form').show(); - $('#logout_form').hide(); - $('#optout_message').hide(); - $('#optout_banner').hide(); }); } }); diff --git a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx index 57a755b7..7d3c2fb9 100644 --- a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx +++ b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx @@ -13,7 +13,7 @@ declare global { // Declare global variables declare const google: any; -// Environment variables with UID_ prefix for both UID2 and EUID +// Set default to uid2 configuration const UID_JS_SDK_NAME = process.env.REACT_APP_UID_JS_SDK_NAME || '__uid2'; const UID_BASE_URL = process.env.REACT_APP_UID_CLIENT_BASE_URL || process.env.REACT_APP_UID_BASE_URL || 'https://operator-integ.uidapi.com'; const SECURE_SIGNALS_SDK_URL = process.env.REACT_APP_UID_SECURE_SIGNALS_SDK_URL || 'https://cdn.integ.uidapi.com/uid2SecureSignal.js'; @@ -50,8 +50,11 @@ const SecureSignalsApp = () => { // Track whether user has attempted to generate a token const loginAttemptedRef = useRef(false); + // Helper function to get SDK instance + const getSDK = () => window[UID_JS_SDK_NAME]; + const updateElements = useCallback((status) => { - const sdk = window[UID_JS_SDK_NAME]; + const sdk = getSDK(); const token = sdk.getAdvertisingToken(); // Check for opt-out: only if user attempted login, and we got identity null with no token @@ -86,7 +89,7 @@ const SecureSignalsApp = () => { return false; }; - const onUid2IdentityUpdated = useCallback( + const onIdentityUpdated = useCallback( (eventType, payload) => { console.log(`${IDENTITY_NAME} Callback`, payload); updateElements(payload); @@ -183,9 +186,9 @@ const SecureSignalsApp = () => { useEffect(() => { // Add callbacks for UID2/EUID JS SDK - const sdk = window[UID_JS_SDK_NAME]; + const sdk = getSDK(); sdk.callbacks = sdk.callbacks || []; - sdk.callbacks.push(onUid2IdentityUpdated); + sdk.callbacks.push(onIdentityUpdated); sdk.callbacks.push((eventType, payload) => { if (eventType === 'SdkLoaded') { sdk.init({ @@ -199,7 +202,7 @@ const SecureSignalsApp = () => { } } }); - }, [identity, onUid2IdentityUpdated]); + }, [identity, onIdentityUpdated]); useEffect(() => { // initialize ads manager @@ -267,7 +270,7 @@ const SecureSignalsApp = () => { try { if (isEnabled('uid2')) { - const sdk = window[UID_JS_SDK_NAME]; + const sdk = getSDK(); await sdk.setIdentityFromEmail(email, clientSideIdentityOptions); loadSecureSignals(); } @@ -279,7 +282,7 @@ const SecureSignalsApp = () => { const handleLogout = () => { window.googletag.secureSignalProviders.clearAllCache(); if (isEnabled('uid2')) { - const sdk = window[UID_JS_SDK_NAME]; + const sdk = getSDK(); sdk.disconnect(); } loginAttemptedRef.current = false; // Reset flag @@ -289,7 +292,7 @@ const SecureSignalsApp = () => { const handleTryAnother = () => { window.googletag.secureSignalProviders.clearAllCache(); if (isEnabled('uid2')) { - const sdk = window[UID_JS_SDK_NAME]; + const sdk = getSDK(); sdk.disconnect(); } setEmail(''); diff --git a/web-integrations/javascript-sdk/client-server/views/index.html b/web-integrations/javascript-sdk/client-server/views/index.html index 7a11d60e..d1d6cafd 100644 --- a/web-integrations/javascript-sdk/client-server/views/index.html +++ b/web-integrations/javascript-sdk/client-server/views/index.html @@ -29,7 +29,7 @@ } } - function onUid2IdentityUpdated(state) { + function onIdentityUpdated(state) { ++callbackCounter; updateGuiElements(state); } @@ -45,7 +45,7 @@ baseUrl: '<%- uidBaseUrl %>', }); - sdk.callbacks.push(onUid2IdentityUpdated); + sdk.callbacks.push(onIdentityUpdated); }); diff --git a/web-integrations/javascript-sdk/client-server/views/login.html b/web-integrations/javascript-sdk/client-server/views/login.html index 749aa5c3..e3c502f8 100644 --- a/web-integrations/javascript-sdk/client-server/views/login.html +++ b/web-integrations/javascript-sdk/client-server/views/login.html @@ -7,7 +7,7 @@ From bdc8ea2349de1e80159d032b974699f20d205db6 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Tue, 28 Oct 2025 15:42:35 -0600 Subject: [PATCH 21/39] update port numbers in readmes --- .../client-server/README.md | 22 ++++--------- .../client-server/views/login.html | 5 +-- .../client-side/README.md | 16 +++++++-- .../react-client-side/README.md | 18 +++++++--- .../server-side/README.md | 16 +++++++-- .../javascript-sdk/client-server/README.md | 33 +++++++------------ .../client-side/index.html | 12 ++++--- web-integrations/server-side/README.md | 25 +++----------- 8 files changed, 74 insertions(+), 73 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index a4b41bd0..1db9df69 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -15,29 +15,19 @@ For an example application without using the SDK, see [Server-Side UID2 or EUID ### Using Docker Compose (Recommended) -From the base directory: +From the repository root directory: ```bash -# Start the service -docker-compose up -d google-secure-signals-client - -# View logs -docker-compose logs google-secure-signals-client - -# Stop the service -docker-compose down google-secure-signals-client +docker compose up google-secure-signals-client-server ``` -### Using Docker directly +The application will be available at http://localhost:3041 -From the base directory: +### Using Docker Build ```bash -# Build the image -docker build -f web-integrations/google-secure-signals/client-server/Dockerfile -t google-secure-signals-client . - -# Run the container -docker run -p 3052:3052 --env-file .env google-secure-signals-client +docker build -f web-integrations/google-secure-signals/client-server/Dockerfile -t google-secure-signals-client-server . +docker run -it --rm -p 3041:3041 --env-file .env google-secure-signals-client-server ``` ### Using the VS Code Debugger diff --git a/web-integrations/google-secure-signals/client-server/views/login.html b/web-integrations/google-secure-signals/client-server/views/login.html index d50e2527..b063e058 100644 --- a/web-integrations/google-secure-signals/client-server/views/login.html +++ b/web-integrations/google-secure-signals/client-server/views/login.html @@ -11,13 +11,14 @@ From 5acb97ad765290feb76decc003c477ebddfa01ab Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 11:23:52 -0600 Subject: [PATCH 29/39] Revert prebid changes - will be handled in separate ticket --- .../prebid-integrations/client-side/index.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/web-integrations/prebid-integrations/client-side/index.html b/web-integrations/prebid-integrations/client-side/index.html index dfe6345a..3a4d9e13 100644 --- a/web-integrations/prebid-integrations/client-side/index.html +++ b/web-integrations/prebid-integrations/client-side/index.html @@ -18,10 +18,10 @@ function updateGuiElements() { console.log('Updating displayed values.'); - const uid2 = pbjs.getUserIds().uid2; // needs to be updated + const uid2 = pbjs.getUserIds().uid2; - let isOptedOut = false; // UID2 returns empty object so we have to check advertising token first - const storedToken = localStorage.getItem('__uid2_advertising_token'); // needs to be updated + let isOptedOut = false; + const storedToken = localStorage.getItem('__uid2_advertising_token'); if (storedToken) { try { const tokenData = JSON.parse(storedToken); @@ -49,9 +49,6 @@ } } - // include consentManagementObj if EUID - // check if just gdprApplies has to be true or the entire things has to exist - async function handleLogin() { const email = $('#email').val(); setUid2Config(email); @@ -81,7 +78,6 @@ }; pbjs.setConfig({ debug: true, - // set consentManagementObject if EUID userSync: { userIds: [ { @@ -121,7 +117,7 @@ var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; pbjs.que.push(function () { - setUid2Config(); // keep the uid2 way where we set uid ahead of time + setUid2Config(); pbjs.addAdUnits(adUnits); pbjs.requestBids(); From 9ab996f88c82c0774fb47378127751971d3be0b8 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 11:27:53 -0600 Subject: [PATCH 30/39] update readmes to include correct port numbers --- .../google-secure-signals/client-server/README.md | 4 ++-- web-integrations/google-secure-signals/client-side/README.md | 2 +- web-integrations/google-secure-signals/server-side/README.md | 4 ++-- web-integrations/javascript-sdk/client-server/README.md | 2 +- web-integrations/javascript-sdk/client-side/README.md | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index bc5fe92c..b0a6580b 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -67,7 +67,7 @@ Output similar to the following indicates that the example application is up and > uid2-publisher@1.0.0 start /usr/src/app > node server.js -Example app listening at http://localhost:3052 +Example app listening at http://localhost:3041 ``` If needed, to close the application, terminate the Docker container or use the `Ctrl+C` keyboard shortcut. @@ -80,7 +80,7 @@ The following table outlines and annotates the steps you can take to test and ex | Step | Description | Comments | | :--: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1 | In your browser, navigate to the application main page at `http://localhost:3052`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3041`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | | 2 | In the text field at the bottom, enter the email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint (see [POST /token/generate](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) for UID2 or [POST /token/generate](https://euid.eu/docs/endpoints/post-token-generate#decrypted-json-response-format) for EUID) and processes the received response. | | | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the POST /token/generate response (see [Decrypted JSON Response Format](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) for UID2 or [Decrypted JSON Response Format](https://euid.eu/docs/endpoints/post-token-generate#decrypted-json-response-format) for EUID). It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the SDK [`init()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party cookie for use on subsequent page loads. | | 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value and a video player. While the [page view](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page view](views/index.html) calls the [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index 7c89c8ca..f4c05078 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -71,7 +71,7 @@ The following table outlines and annotates the steps you may take to test and ex | Step | Description | Comments | | :--: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main [page](views/index.html) of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3042`. | The displayed main [page](views/index.html) of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | | 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage. Then, it makes a call on the client side to the `setIdentityFromEmail` function of the JavaScript SDK. For details, see [Configuring the SDK for Javascript](https://unifiedid.com/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript) (UID2) or [Configuring the SDK for Javascript](https://euid.eu/docs/guides/integration-javascript-client-side#configure-the-sdk-for-javascript) (EUID). | | 3 | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the `client-generate` response (see [Decrypted JSON Response Format](https://unifiedid.com/docs/endpoints/post-token-generate#decrypted-json-response-format) for UID2 or [Decrypted JSON Response Format](https://euid.eu/docs/endpoints/post-token-generate#decrypted-json-response-format) for EUID). Next, the identity information is passed to the SDK [`setIdentity()`](https://unifiedid.com/docs/sdks/sdk-ref-javascript#setidentityidentity-identity-void) function. If the identity is valid, the SDK stores it either in local storage or a first-party cookie for use on subsequent page loads. | | 4 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value and a video player. While the [page](views/index.html) is loading, [GPT](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage, and the [IMA](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) makes an ad request which transmits the encoded signal in the request. The [page](views/index.html) calls the SDK [init()](https://unifiedid.com/docs/sdks/sdk-ref-javascript#initopts-object-void) function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie or local storage. | diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index b3c99ca8..a171adfc 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -64,7 +64,7 @@ Output similar to the following indicates that the example application is up and > uid2-publisher@1.0.0 start /usr/src/app > node server.js -Example app listening at http://localhost:3000 +Example app listening at http://localhost:3043 ``` If needed, to close the application, terminate the Docker container or use the `Ctrl+C` keyboard shortcut. @@ -89,7 +89,7 @@ The following table outlines and annotates the steps you can take to test and ex | Step | Description | Comments | | :--: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3043`. | The displayed main (index) page of the example application provides a [login form](views/login.html) for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to consent to targeted advertising. | | 2 | Enter the email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | The click calls the Secure Signal [`clearAllCache()`](https://developers.google.com/publisher-tag/reference#googletag.secureSignals.SecureSignalProvidersArray_clearAllCache) function, to clear all cached signals from local storage, and then calls the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint and processes the received response. | | | The main page updates to display the established identity information and a video player. | The displayed identity information is the `body` property of the JSON response payload from the successful POST /token/generate response. If the response is successful, the returned identity is saved to a session cookie (a real-world application would use a different way to store session data) and the protected index page is rendered. While the main page is loading, [Google Publisher Tag (GPT)](https://developers.google.com/publisher-tag/reference#googletag) auto-loads the Secure Signal script which pushes the advertising token to GPT local storage. The [Interactive Media Ads (IMA) SDK](https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side) then makes an ad request, and transmits the encoded signal in the request. | | 4 | Click **Play**. | This triggers AdsManager to insert the ad returned from the ad request, for display. The ad tag used in this example contains a 10-second pre-roll ad. | diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 2c7fed26..5030c49c 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -63,7 +63,7 @@ The following table outlines and annotates the steps you may take to test and ex | Step | Description | Comments | | :--: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1 | In your browser, navigate to the application main page at `http://localhost:3000`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | +| 1 | In your browser, navigate to the application main page at `http://localhost:3032`. | The displayed main ([index](views/index.html)) page of the example application provides a login form for the user to complete the UID2/EUID login process.
IMPORTANT: A real-life application must also display a form for the user to express their consent to targeted advertising. | | 2 | In the text field at the bottom, enter the user email address that you want to use for testing and click **Generate UID2** or **Generate EUID**. Note: The button label depends on your environment configuration; in a real production environment, labels may differ. | This is a call to the `/login` endpoint ([server.js](server.js)). The login initiated on the server side then calls the POST /token/generate endpoint and processes the received response. | | | A confirmation message appears with the established identity information. | The displayed identity information is the `body` property of the JSON response payload from the POST /token/generate response. It has been passed to the `login` [view](views/login.html) for rendering client-side JavaScript. Next, the identity information is passed to the SDK `init()` function. If the identity is valid, the SDK stores it in a first-party cookie for use on subsequent page loads. | | 3 | Click the **Back to the main page** link. | On the updated application main page, note the newly populated **Advertising Token** value. The [page view](views/index.html) calls the init() function again, but this time without passing an explicit identity. Instead, the identity is loaded from the first-party cookie. | diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 99ddf959..2922e248 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -48,8 +48,8 @@ The application uses environment variables from the `.env` file in the base dire | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_CLIENT_BASE_URL` | API base URL for client-side/browser calls | UID2: `https://operator-integ.uidapi.com` or `http://localhost:8080`
EUID: `https://integ.euid.eu/v2` | | `UID_BASE_URL` | Fallback API base URL (used if `UID_CLIENT_BASE_URL` not set) | Same as above | -| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Partner Portal or your integration representative. | Your assigned server public key | -| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Partner Portal or your integration representative. | Your assigned subscription ID | +| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned server public key | +| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned subscription ID | ### Display/UI Configuration From 9ddbd2dcf117a6c2be45edcbe3c566a22871a312 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 11:43:43 -0600 Subject: [PATCH 31/39] clean up google secure loading logic in react app --- .../client-side/html/scripts/scripts.js | 6 ++++++ .../google-secure-signals/server-side/views/header.html | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js index 2e734c5c..ca349fd9 100644 --- a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js +++ b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js @@ -98,6 +98,12 @@ sdk.callbacks.push((eventType, payload) => { }); $(document).ready(() => { onDocumentReady(); + + // Set initial UI state - updateGuiElements will adjust based on actual identity state + $('#login_form').show(); + $('#logout_form').hide(); + $('#optout_message').hide(); + $('#optout_banner').hide(); }); } }); diff --git a/web-integrations/google-secure-signals/server-side/views/header.html b/web-integrations/google-secure-signals/server-side/views/header.html index 6daa8e24..e6b4b7c2 100644 --- a/web-integrations/google-secure-signals/server-side/views/header.html +++ b/web-integrations/google-secure-signals/server-side/views/header.html @@ -20,8 +20,7 @@ window.getAdvertisingToken = getAdvertisingToken; // If secureSignalProvider is initialized before getAdvertisingToken is assigned, call registerSecureSignalProvider - const productId = '<%- identityName %>'.toLowerCase(); // 'uid2' or 'euid' - const providerName = '__' + productId + 'SecureSignalProvider'; + const providerName = '__' + '<%- identityName %>'.toLowerCase() + 'SecureSignalProvider'; if (window[providerName]) { window[providerName].registerSecureSignalProvider(); } From 697880db8993fab689dad65b153d0e14dddaf872 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 12:19:40 -0600 Subject: [PATCH 32/39] add back ad tag and fix read me instances of partner portal --- .../client-server/README.md | 2 + .../client-server/public/ads.js | 3 +- .../src/SecureSignalsApp.tsx | 43 ++++--------------- .../server-side/README.md | 2 + .../server-side/public/ads.js | 3 +- 5 files changed, 16 insertions(+), 37 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index b0a6580b..d209f313 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -61,6 +61,8 @@ The easiest way to try the example is to do the following: | `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | +**Note:** The example uses a Google IMA sample ad tag URL in `public/ads.js`. To test with your own ad tag, edit line 56 in `public/ads.js` to use your ad tag URL. + Output similar to the following indicates that the example application is up and running. ``` diff --git a/web-integrations/google-secure-signals/client-server/public/ads.js b/web-integrations/google-secure-signals/client-server/public/ads.js index fc92752e..98ce8b29 100644 --- a/web-integrations/google-secure-signals/client-server/public/ads.js +++ b/web-integrations/google-secure-signals/client-server/public/ads.js @@ -52,7 +52,8 @@ function setUpIMA() { // Request video ads. const adsRequest = new google.ima.AdsRequest(); - adsRequest.adTagUrl = '${AD_TAG_URL}'; + // Using Google IMA sample ad tag - replace with your own ad tag URL for production + adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator='; // Specify the linear and nonlinear slot sizes. This helps the SDK to // select the correct creative if multiple are returned. diff --git a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx index 9b3065e8..f7b962fe 100644 --- a/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx +++ b/web-integrations/google-secure-signals/react-client-side/src/SecureSignalsApp.tsx @@ -20,7 +20,6 @@ const SECURE_SIGNALS_SDK_URL = process.env.REACT_APP_UID_SECURE_SIGNALS_SDK_URL const SECURE_SIGNALS_STORAGE_KEY = process.env.REACT_APP_UID_SECURE_SIGNALS_STORAGE_KEY || '_GESPSK-uidapi.com'; const IDENTITY_NAME = process.env.REACT_APP_IDENTITY_NAME; const DOCS_BASE_URL = process.env.REACT_APP_DOCS_BASE_URL; -const PRODUCT_ID = UID_JS_SDK_NAME.replace('__', ''); // 'uid2' or 'euid' const clientSideIdentityOptions = { subscriptionId: process.env.REACT_APP_UID_CSTG_SUBSCRIPTION_ID || 'toPh8vgJgt', @@ -38,7 +37,6 @@ const SecureSignalsApp = () => { const [identityState, setIdentityState] = useState(''); const [email, setEmail] = useState(''); const [identity, setIdentity] = useState(null); - const [isUid2Enabled, setIsUid2Enabled] = useState(true); const [adsLoaded, setAdsLoaded] = useState(false); const [isOptedOut, setIsOptedOut] = useState(false); @@ -83,13 +81,6 @@ const SecureSignalsApp = () => { setTimeout(updateSecureSignals, 500); }, []); - const isEnabled = (product: string): boolean => { - if (product === 'uid2') { - return isUid2Enabled; - } - return false; - }; - const onIdentityUpdated = useCallback( (eventType, payload) => { console.log(`${IDENTITY_NAME} Callback`, payload); @@ -270,11 +261,9 @@ const SecureSignalsApp = () => { loginAttemptedRef.current = true; // Mark that user attempted to generate a token try { - if (isEnabled(PRODUCT_ID)) { - const sdk = getSDK(); - await sdk.setIdentityFromEmail(email, clientSideIdentityOptions); - loadSecureSignals(); - } + const sdk = getSDK(); + await sdk.setIdentityFromEmail(email, clientSideIdentityOptions); + loadSecureSignals(); } catch (e) { console.error('setIdentityFromEmail failed', e); } @@ -282,20 +271,16 @@ const SecureSignalsApp = () => { const handleLogout = () => { window.googletag.secureSignalProviders.clearAllCache(); - if (isEnabled(PRODUCT_ID)) { - const sdk = getSDK(); - sdk.disconnect(); - } + const sdk = getSDK(); + sdk.disconnect(); loginAttemptedRef.current = false; // Reset flag setIsOptedOut(false); }; const handleTryAnother = () => { window.googletag.secureSignalProviders.clearAllCache(); - if (isEnabled(PRODUCT_ID)) { - const sdk = getSDK(); - sdk.disconnect(); - } + const sdk = getSDK(); + sdk.disconnect(); setEmail(''); loginAttemptedRef.current = false; // Reset flag setIsOptedOut(false); @@ -322,10 +307,6 @@ const SecureSignalsApp = () => { } }; - const handleCheckboxChange = (e: any) => { - setIsUid2Enabled(e.target.checked); - }; - return (

@@ -357,15 +338,7 @@ const SecureSignalsApp = () => { - + diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index a171adfc..9a8c4d7d 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -58,6 +58,8 @@ docker run -it --rm -p 3043:3043 --env-file .env google-secure-signals-server-si | `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | | `DOCS_BASE_URL` | Documentation base URL | UID2: `https://unifiedid.com/docs`
EUID: `https://euid.eu/docs` | +**Note:** The example uses a Google IMA sample ad tag URL in `public/ads.js`. To test with your own ad tag, edit line 56 in `public/ads.js` to use your ad tag URL. + Output similar to the following indicates that the example application is up and running. ``` diff --git a/web-integrations/google-secure-signals/server-side/public/ads.js b/web-integrations/google-secure-signals/server-side/public/ads.js index b575cf95..ce1d698d 100644 --- a/web-integrations/google-secure-signals/server-side/public/ads.js +++ b/web-integrations/google-secure-signals/server-side/public/ads.js @@ -52,7 +52,8 @@ function setUpIMA() { // Request video ads. const adsRequest = new google.ima.AdsRequest(); - adsRequest.adTagUrl = '${AD_TAG_URL}'; + // Using Google IMA sample ad tag - replace with your own ad tag URL for production + adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator='; // Specify the linear and nonlinear slot sizes. This helps the SDK to // select the correct creative if multiple are returned. From 15a1fb65ef348dcb6b7e045b6294578de6efc100 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 12:36:33 -0600 Subject: [PATCH 33/39] update return logic for client server flow --- .../google-secure-signals/client-server/views/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/web-integrations/google-secure-signals/client-server/views/index.html b/web-integrations/google-secure-signals/client-server/views/index.html index 4cb99d6e..fe5ba606 100644 --- a/web-integrations/google-secure-signals/client-server/views/index.html +++ b/web-integrations/google-secure-signals/client-server/views/index.html @@ -52,7 +52,6 @@ }); $("#login").click(() => { window.googletag.secureSignalProviders.clearAllCache(); - updateGuiElements(undefined); }); sdk.callbacks.push((eventType, payload) => { if (eventType === "SdkLoaded") { From 10ef7cdc53eb5cbd5154bba04785f3a763cdccf8 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 12:41:04 -0600 Subject: [PATCH 34/39] remove all aprtner portal references in the readmes --- .../google-secure-signals/client-server/README.md | 4 ++-- web-integrations/google-secure-signals/client-side/README.md | 4 ++-- web-integrations/google-secure-signals/server-side/README.md | 4 ++-- web-integrations/javascript-sdk/client-server/README.md | 4 ++-- web-integrations/server-side/README.md | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index d209f313..4ff9c46b 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -53,8 +53,8 @@ The easiest way to try the example is to do the following: | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service for server-side API calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | +| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index f4c05078..c072850f 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -48,8 +48,8 @@ docker run -it --rm -p 3042:3042 --env-file .env google-secure-signals-client-si |:---------|:------------|:---------------| | `UID_CLIENT_BASE_URL` | API base URL for client-side/browser calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | | `UID_BASE_URL` | Fallback API base URL (used if `UID_CLIENT_BASE_URL` not set) | Same as above | -| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Partner Portal or your integration representative. | Your assigned server public key | -| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Partner Portal or your integration representative. | Your assigned subscription ID | +| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned server public key | +| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned subscription ID | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 9a8c4d7d..3f418589 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -51,8 +51,8 @@ docker run -it --rm -p 3043:3043 --env-file .env google-secure-signals-server-si | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service for server-side API calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | +| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | | `SESSION_KEY` | The key to the encryption session data stored in the application's session cookie | Any secure random string | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | | `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 5030c49c..d92b6ca1 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -38,8 +38,8 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | +| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 4b849394..234063a4 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -37,8 +37,8 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Partner Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | +| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | | `SESSION_KEY` | The key to the encryption session data stored in the application session cookie. This can be any arbitrary string. | Any secure random string | ### Display/UI Configuration From d16f545368c9e4e061803d9948e4a1890f23ca7e Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 12:54:22 -0600 Subject: [PATCH 35/39] add back helpful comments to docker commands in readmes --- .../client-server/README.md | 14 ++++++++++++ .../client-side/README.md | 14 ++++++++++++ .../react-client-side/README.md | 14 ++++++++++++ .../server-side/README.md | 14 ++++++++++++ .../javascript-sdk/client-server/README.md | 14 ++++++++++++ .../javascript-sdk/client-side/README.md | 22 +++++++++++-------- web-integrations/server-side/README.md | 14 ++++++++++++ 7 files changed, 97 insertions(+), 9 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index 4ff9c46b..e779a415 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -18,15 +18,29 @@ For an example application without using the SDK, see [Server-Side UID2 or EUID From the repository root directory: ```bash +# Start the service docker compose up google-secure-signals-client-server ``` The application will be available at http://localhost:3041 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs google-secure-signals-client-server + +# Stop the service +docker compose down +``` + ### Using Docker Build ```bash +# Build the image docker build -f web-integrations/google-secure-signals/client-server/Dockerfile -t google-secure-signals-client-server . + +# Run the container docker run -it --rm -p 3041:3041 --env-file .env google-secure-signals-client-server ``` diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index c072850f..023c434c 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -30,15 +30,29 @@ Then update the `.env` file with your credentials. From the repository root directory: ```bash +# Start the service docker compose up google-secure-signals-client-side ``` The application will be available at http://localhost:3042 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs google-secure-signals-client-side + +# Stop the service +docker compose down +``` + #### Using Docker Build ```bash +# Build the image docker build -f web-integrations/google-secure-signals/client-side/Dockerfile -t google-secure-signals-client-side . + +# Run the container docker run -it --rm -p 3042:3042 --env-file .env google-secure-signals-client-side ``` diff --git a/web-integrations/google-secure-signals/react-client-side/README.md b/web-integrations/google-secure-signals/react-client-side/README.md index d78e57e6..1bf6e01b 100644 --- a/web-integrations/google-secure-signals/react-client-side/README.md +++ b/web-integrations/google-secure-signals/react-client-side/README.md @@ -44,15 +44,29 @@ Alternatively, you can build and run the example using Docker (note: this may ta From the repository root directory: ```bash +# Start the service docker compose up google-secure-signals-react-client-side ``` The application will be available at http://localhost:3044 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs google-secure-signals-react-client-side + +# Stop the service +docker compose down +``` + #### Using Docker Build ```bash +# Build the image docker build -f web-integrations/google-secure-signals/react-client-side/Dockerfile -t google-secure-signals-react-client-side . + +# Run the container docker run -it --rm -p 3044:3044 --env-file .env google-secure-signals-react-client-side ``` diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 3f418589..3f20509b 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -34,15 +34,29 @@ Then update the `.env` file with your credentials. From the repository root directory: ```bash +# Start the service docker compose up google-secure-signals-server-side ``` The application will be available at http://localhost:3043 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs google-secure-signals-server-side + +# Stop the service +docker compose down +``` + #### Using Docker Build ```bash +# Build the image docker build -f web-integrations/google-secure-signals/server-side/Dockerfile -t google-secure-signals-server-side . + +# Run the container docker run -it --rm -p 3043:3043 --env-file .env google-secure-signals-server-side ``` diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index d92b6ca1..147228b9 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -19,15 +19,29 @@ For an example application without using the SDK, see [Server-Side UID2 or EUID From the repository root directory: ```bash +# Start the service docker compose up javascript-sdk-client-server ``` The application will be available at http://localhost:3032 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs javascript-sdk-client-server + +# Stop the service +docker compose down +``` + ### Using Docker Build ```bash +# Build the image docker build -f web-integrations/javascript-sdk/client-server/Dockerfile -t javascript-sdk-client-server . + +# Run the container docker run -it --rm -p 3032:3032 --env-file .env javascript-sdk-client-server ``` diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 2922e248..9cf53aa8 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -11,29 +11,33 @@ This example can be configured for either UID2 or EUID — the behavior is deter ### Using Docker Compose (Recommended) -From the base directory: +From the repository root directory: ```bash # Start the service -docker-compose up -d javascript-sdk-client-side +docker compose up javascript-sdk-client-side +``` + +The application will be available at http://localhost:3031 -# View logs -docker-compose logs javascript-sdk-client-side +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs javascript-sdk-client-side # Stop the service -docker-compose down javascript-sdk-client-side +docker compose down ``` -### Using Docker directly - -From the base directory: +### Using Docker Build ```bash # Build the image docker build -f web-integrations/javascript-sdk/client-side/Dockerfile -t javascript-sdk-client-side . # Run the container -docker run -p 3032:3032 --env-file .env javascript-sdk-client-side +docker run -it --rm -p 3031:3031 --env-file .env javascript-sdk-client-side ``` ## Environment Variables diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 234063a4..23e3570a 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -18,15 +18,29 @@ For an example application using the SDK, see [Client-Server UID2 or EUID Integr From the repository root directory: ```bash +# Start the service docker compose up server-side ``` The application will be available at http://localhost:3033 +To view logs or stop the service: + +```bash +# View logs (in another terminal) +docker compose logs server-side + +# Stop the service +docker compose down +``` + ### Using Docker Build ```bash +# Build the image docker build -f web-integrations/server-side/Dockerfile -t server-side . + +# Run the container docker run -it --rm -p 3033:3033 --env-file .env server-side ``` From 53ac12f82266a58f0bc5492202fa93808b0a4a51 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 13:05:01 -0600 Subject: [PATCH 36/39] add back docker comman path for down instructions --- web-integrations/google-secure-signals/client-server/README.md | 2 +- web-integrations/google-secure-signals/client-side/README.md | 2 +- .../google-secure-signals/react-client-side/README.md | 2 +- web-integrations/google-secure-signals/server-side/README.md | 2 +- web-integrations/javascript-sdk/client-server/README.md | 2 +- web-integrations/javascript-sdk/client-side/README.md | 2 +- web-integrations/server-side/README.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index e779a415..60fdd10d 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -31,7 +31,7 @@ To view logs or stop the service: docker compose logs google-secure-signals-client-server # Stop the service -docker compose down +docker compose stop google-secure-signals-client-server ``` ### Using Docker Build diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index 023c434c..1d5e9b3f 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -43,7 +43,7 @@ To view logs or stop the service: docker compose logs google-secure-signals-client-side # Stop the service -docker compose down +docker compose stop google-secure-signals-client-side ``` #### Using Docker Build diff --git a/web-integrations/google-secure-signals/react-client-side/README.md b/web-integrations/google-secure-signals/react-client-side/README.md index 1bf6e01b..1b2014c4 100644 --- a/web-integrations/google-secure-signals/react-client-side/README.md +++ b/web-integrations/google-secure-signals/react-client-side/README.md @@ -57,7 +57,7 @@ To view logs or stop the service: docker compose logs google-secure-signals-react-client-side # Stop the service -docker compose down +docker compose stop google-secure-signals-react-client-side ``` #### Using Docker Build diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 3f20509b..11c4459a 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -47,7 +47,7 @@ To view logs or stop the service: docker compose logs google-secure-signals-server-side # Stop the service -docker compose down +docker compose stop google-secure-signals-server-side ``` #### Using Docker Build diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 147228b9..62fb072d 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -32,7 +32,7 @@ To view logs or stop the service: docker compose logs javascript-sdk-client-server # Stop the service -docker compose down +docker compose stop javascript-sdk-client-server ``` ### Using Docker Build diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index 9cf53aa8..d8ee1fca 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -27,7 +27,7 @@ To view logs or stop the service: docker compose logs javascript-sdk-client-side # Stop the service -docker compose down +docker compose stop javascript-sdk-client-side ``` ### Using Docker Build diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 23e3570a..0231fda6 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -31,7 +31,7 @@ To view logs or stop the service: docker compose logs server-side # Stop the service -docker compose down +docker compose stop server-side ``` ### Using Docker Build From e5eca85964df7e0ada3afeb8378493551dc58de2 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 14:12:40 -0600 Subject: [PATCH 37/39] remove portal refs in readme --- .../google-secure-signals/client-server/README.md | 4 ++-- web-integrations/google-secure-signals/client-side/README.md | 4 ++-- web-integrations/google-secure-signals/server-side/README.md | 4 ++-- web-integrations/javascript-sdk/client-server/README.md | 4 ++-- web-integrations/javascript-sdk/client-side/README.md | 4 ++-- web-integrations/server-side/README.md | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/web-integrations/google-secure-signals/client-server/README.md b/web-integrations/google-secure-signals/client-server/README.md index 60fdd10d..391f7917 100644 --- a/web-integrations/google-secure-signals/client-server/README.md +++ b/web-integrations/google-secure-signals/client-server/README.md @@ -67,8 +67,8 @@ The easiest way to try the example is to do the following: | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service for server-side API calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Your UID2/EUID authentication key for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned API key | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned client secret | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | diff --git a/web-integrations/google-secure-signals/client-side/README.md b/web-integrations/google-secure-signals/client-side/README.md index 1d5e9b3f..2e012a33 100644 --- a/web-integrations/google-secure-signals/client-side/README.md +++ b/web-integrations/google-secure-signals/client-side/README.md @@ -62,8 +62,8 @@ docker run -it --rm -p 3042:3042 --env-file .env google-secure-signals-client-si |:---------|:------------|:---------------| | `UID_CLIENT_BASE_URL` | API base URL for client-side/browser calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | | `UID_BASE_URL` | Fallback API base URL (used if `UID_CLIENT_BASE_URL` not set) | Same as above | -| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned server public key | -| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned subscription ID | +| `UID_CSTG_SERVER_PUBLIC_KEY` | Your server public key for client-side token generation for the UID2/EUID service specified in UID_BASE_URL. | Your assigned server public key | +| `UID_CSTG_SUBSCRIPTION_ID` | Your subscription ID for client-side token generation for the UID2/EUID service specified in UID_BASE_URL. | Your assigned subscription ID | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | diff --git a/web-integrations/google-secure-signals/server-side/README.md b/web-integrations/google-secure-signals/server-side/README.md index 11c4459a..9625113f 100644 --- a/web-integrations/google-secure-signals/server-side/README.md +++ b/web-integrations/google-secure-signals/server-side/README.md @@ -65,8 +65,8 @@ docker run -it --rm -p 3043:3043 --env-file .env google-secure-signals-server-si | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service for server-side API calls | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Your UID2/EUID authentication key for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned API key | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned client secret | | `SESSION_KEY` | The key to the encryption session data stored in the application's session cookie | Any secure random string | | `UID_SECURE_SIGNALS_SDK_URL` | URL to the Secure Signals SDK | UID2: `https://cdn.integ.uidapi.com/uid2SecureSignal.js`
EUID: `https://cdn.integ.euid.eu/euidSecureSignal.js` | | `IDENTITY_NAME` | Identity name for UI display | UID2: `UID2`
EUID: `EUID` | diff --git a/web-integrations/javascript-sdk/client-server/README.md b/web-integrations/javascript-sdk/client-server/README.md index 62fb072d..248d0f7f 100644 --- a/web-integrations/javascript-sdk/client-server/README.md +++ b/web-integrations/javascript-sdk/client-server/README.md @@ -52,8 +52,8 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Your UID2/EUID authentication key for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned API key | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned client secret | | `UID_JS_SDK_URL` | URL to the JavaScript SDK | UID2: `https://cdn.integ.uidapi.com/uid2-sdk-4.0.1.js`
EUID: `https://cdn.integ.euid.eu/euid-sdk-4.0.1.js` | | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | diff --git a/web-integrations/javascript-sdk/client-side/README.md b/web-integrations/javascript-sdk/client-side/README.md index d8ee1fca..5319c837 100644 --- a/web-integrations/javascript-sdk/client-side/README.md +++ b/web-integrations/javascript-sdk/client-side/README.md @@ -52,8 +52,8 @@ The application uses environment variables from the `.env` file in the base dire | `UID_JS_SDK_NAME` | Global variable name for the SDK | UID2: `__uid2`
EUID: `__euid` | | `UID_CLIENT_BASE_URL` | API base URL for client-side/browser calls | UID2: `https://operator-integ.uidapi.com` or `http://localhost:8080`
EUID: `https://integ.euid.eu/v2` | | `UID_BASE_URL` | Fallback API base URL (used if `UID_CLIENT_BASE_URL` not set) | Same as above | -| `UID_CSTG_SERVER_PUBLIC_KEY` | Server public key for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned server public key | -| `UID_CSTG_SUBSCRIPTION_ID` | Subscription ID for client-side token generation. Provided via the UID2 Portal or your integration representative. | Your assigned subscription ID | +| `UID_CSTG_SERVER_PUBLIC_KEY` | Your server public key for client-side token generation for the UID2/EUID service specified in UID_BASE_URL. | Your assigned server public key | +| `UID_CSTG_SUBSCRIPTION_ID` | Your subscription ID for client-side token generation for the UID2/EUID service specified in UID_BASE_URL. | Your assigned subscription ID | ### Display/UI Configuration diff --git a/web-integrations/server-side/README.md b/web-integrations/server-side/README.md index 0231fda6..ad22406d 100644 --- a/web-integrations/server-side/README.md +++ b/web-integrations/server-side/README.md @@ -51,8 +51,8 @@ The following table lists the environment variables that you must specify to sta | Variable | Description | Example Values | |:---------|:------------|:---------------| | `UID_SERVER_BASE_URL` | The base URL of the UID2/EUID service. For details, see [Environments](https://unifiedid.com/docs/getting-started/gs-environments) (UID2) or [Environments](https://euid.eu/docs/getting-started/gs-environments) (EUID). | UID2: `https://operator-integ.uidapi.com`
EUID: `https://integ.euid.eu/v2` | -| `UID_API_KEY` | Authentication key for accessing UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned API key | -| `UID_CLIENT_SECRET` | Private key used with your API key to authenticate your app with UID2/EUID services. Provided via the UID2 Portal or your integration representative. | Your assigned client secret | +| `UID_API_KEY` | Your UID2/EUID authentication key for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned API key | +| `UID_CLIENT_SECRET` | Your UID2/EUID client secret for the UID2/EUID service specified in UID_SERVER_BASE_URL. | Your assigned client secret | | `SESSION_KEY` | The key to the encryption session data stored in the application session cookie. This can be any arbitrary string. | Any secure random string | ### Display/UI Configuration From 6cabfee4a902f601af5c507d38f3b3fe5f45e5da Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 15:00:23 -0600 Subject: [PATCH 38/39] add back disconnect line for cleaner reload --- .../google-secure-signals/client-side/html/scripts/scripts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js index ca349fd9..ddf98828 100644 --- a/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js +++ b/web-integrations/google-secure-signals/client-side/html/scripts/scripts.js @@ -97,6 +97,10 @@ sdk.callbacks.push((eventType, payload) => { baseUrl: '${UID_BASE_URL}', }); $(document).ready(() => { + // Clear any existing identity on page load for clean state + sdk.disconnect(); + loginAttempted = false; + onDocumentReady(); // Set initial UI state - updateGuiElements will adjust based on actual identity state From 9216f1054dcca5ff8001f1ee88b5e464cc611237 Mon Sep 17 00:00:00 2001 From: Eiman Eltigani Date: Wed, 29 Oct 2025 15:09:11 -0600 Subject: [PATCH 39/39] remove portal reference in env --- .env.sample.uid2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.sample.uid2 b/.env.sample.uid2 index ee49d29e..f57c04b0 100644 --- a/.env.sample.uid2 +++ b/.env.sample.uid2 @@ -9,18 +9,18 @@ # ⚠️ EDIT THESE VALUES FIRST - Your UID2 Credentials ⚠️ # ============================================================================== -# Server-Side & Client-Server Examples - Provided by UID2 Portal or your integration representative +# Server-Side & Client-Server Examples UID_API_KEY="your-api-key" UID_CLIENT_SECRET="your-client-secret" # Server-Side Examples - Any secure random string for session encryption SESSION_KEY="your-session-key-here" -# Client-Side Token Generation (CSTG) - Provided by UID2 Portal or your integration representative +# Client-Side Token Generation (CSTG) UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q==" UID_CSTG_SUBSCRIPTION_ID="DMr7uHxqLU" -# React Client-Side Examples - Provided by UID2 Portal or your integration representative +# React Client-Side Examples # Note: These are the same values as the variables above, prefixed with REACT_APP_ # for use in React applications. Use your same UID2 credentials from above. REACT_APP_UID_CSTG_SERVER_PUBLIC_KEY="UID2-X-I-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+jcPlk8GWn3iG0R5Il2cbFQI9hR3TvHxaBUKHl5Vh+ugr+9uLMiXihka8To07ETFGghEifY96Hrpe5RnYko7Q=="
- {IDENTITY_NAME} Enabled{' '} - - {IDENTITY_NAME} Status