Skip to content

Commit f31fcc7

Browse files
update read me organization
1 parent 26364d8 commit f31fcc7

File tree

1 file changed

+6
-56
lines changed
  • web-integrations/prebid-integrations/client-server

1 file changed

+6
-56
lines changed

web-integrations/prebid-integrations/client-server/README.md

Lines changed: 6 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ You have two options for testing:
1717

1818
### 2. Set Up Environment Variables
1919

20-
Create a `.env` file in the **root of the uid2-examples repository** with the following:
20+
Create a `.env` file in the **root of the uid2-examples repository** (NOT in this folder) with the following:
2121

2222
```bash
2323
UID2_BASE_URL=http://host.docker.internal:8080
2424
UID2_API_KEY=your-api-key-here
2525
UID2_CLIENT_SECRET=your-client-secret-here
2626
```
2727

28+
**Important:** The `.env` file must be at `/uid2-examples/.env`, not `/uid2-examples/web-integrations/prebid-integrations/client-server/.env`.
29+
2830
See the instructions below for your chosen environment to get the correct values.
2931

3032
### 3. Build and Run
@@ -43,8 +45,6 @@ To stop, press `Ctrl+C` or run:
4345
docker-compose down
4446
```
4547

46-
---
47-
4848
## Testing Environment Setup
4949

5050
### Option A: Local UID2 Operator
@@ -83,6 +83,8 @@ Open `src/main/resources/clients/clients.json` and find a client entry with the
8383

8484
#### 4. Update Your .env File
8585

86+
In the **root of the uid2-examples repository** (at `/uid2-examples/.env`), add:
87+
8688
```bash
8789
UID2_BASE_URL=http://host.docker.internal:8080
8890
UID2_API_KEY=UID2-C-L-124-H8VwqX.l2G4TCuUWYAqdqkeG/UqtFoPEoXirKn4kHWxc=
@@ -93,8 +95,6 @@ UID2_CLIENT_SECRET=NcMgi6Y8C80SlxvV7pYlfcvEIo+2b0508tYQ3pKK8HM=
9395

9496
Follow the [UID2 Operator README](https://github.com/IABTechLab/uid2-operator) instructions to start the operator. It will run on `http://localhost:8080`.
9597

96-
---
97-
9898
### Option B: Integration Environment
9999

100100
This option uses the hosted UID2 integration environment (deployed version).
@@ -105,51 +105,15 @@ Contact your UID2 representative or use the [UID2 Portal](https://unifiedid.com/
105105

106106
#### 2. Update Your .env File
107107

108-
```bash
109-
UID2_BASE_URL=https://operator-integ.uidapi.com
110-
UID2_API_KEY=your-integ-api-key
111-
UID2_CLIENT_SECRET=your-integ-client-secret
112-
```
113-
114-
---
115-
116-
## Run Locally Without Docker
117-
118-
If you prefer to run without Docker:
119-
120-
### 1. Install Dependencies
108+
In the **root of the uid2-examples repository** (at `/uid2-examples/.env`), add:
121109

122-
```bash
123-
npm install
124-
```
125-
126-
### 2. Set Up Environment Variables
127-
128-
Create a `.env` file in the **root of the uid2-examples repository** (same as Docker setup above).
129-
130-
**For local operator:**
131-
```bash
132-
UID2_BASE_URL=http://localhost:8080
133-
UID2_API_KEY=UID2-C-L-124-H8VwqX.l2G4TCuUWYAqdqkeG/UqtFoPEoXirKn4kHWxc=
134-
UID2_CLIENT_SECRET=NcMgi6Y8C80SlxvV7pYlfcvEIo+2b0508tYQ3pKK8HM=
135-
```
136-
137-
**For integration environment:**
138110
```bash
139111
UID2_BASE_URL=https://operator-integ.uidapi.com
140112
UID2_API_KEY=your-integ-api-key
141113
UID2_CLIENT_SECRET=your-integ-client-secret
142114
```
143115

144-
### 3. Start the Server
145116

146-
```bash
147-
npm start
148-
```
149-
150-
The application will be available at `http://localhost:3052`
151-
152-
---
153117

154118
## Testing the Application
155119

@@ -201,8 +165,6 @@ Enter an opted-out email and click "Generate UID2".
201165
- "UID2 Advertising Token: **This email has opted out.**"
202166
- Console shows: `UID2 status: optout`
203167

204-
---
205-
206168
## Environment Variables
207169

208170
| Variable | Description | Example |
@@ -213,8 +175,6 @@ Enter an opted-out email and click "Generate UID2".
213175

214176
**Note:** For Docker, use `http://host.docker.internal:8080` instead of `http://localhost:8080` to access services on your host machine.
215177

216-
---
217-
218178
## How It Works
219179

220180
This example implements the [UID2 Client-Server Integration Guide for Prebid.js](https://unifiedid.com/docs/guides/integration-prebid-client-server).
@@ -234,8 +194,6 @@ This example implements the [UID2 Client-Server Integration Guide for Prebid.js]
234194
4. Configures Prebid.js with the UID2 token using `pbjs.setConfig()`
235195
5. Prebid.js includes the UID2 in bid requests
236196

237-
---
238-
239197
## Troubleshooting
240198

241199
### "Request failed with status code 401"
@@ -254,21 +212,13 @@ This example implements the [UID2 Client-Server Integration Guide for Prebid.js]
254212
**For Docker:**
255213
- Ensure `UID2_BASE_URL` uses `host.docker.internal:8080` not `localhost:8080`
256214

257-
### Token Doesn't Persist
258-
259-
- Check browser localStorage for `__uid2_advertising_token` key
260-
- Verify no browser extensions are clearing storage
261-
- Check browser console for JavaScript errors
262-
263215
### Prebid Doesn't Have the UID2
264216

265217
Run `pbjs.getUserIds()` in console:
266218
- If empty or missing `uid2`, check console for Prebid errors
267219
- Verify Prebid.js loaded correctly (check Network tab)
268220
- Ensure `setPrebidConfig()` is being called after token generation
269221

270-
---
271-
272222
## Additional Resources
273223

274224
- [UID2 Client-Server Integration Guide for Prebid.js](https://unifiedid.com/docs/guides/integration-prebid-client-server)

0 commit comments

Comments
 (0)