Skip to content

Commit 782b52c

Browse files
authored
Docs: Add build instructions and module details to Start.io ID system documentation (#5)
1 parent 583efac commit 782b52c

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

modules/startioBidAdapter.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ const converter = ortbConverter({
5151
request.regs.ext.us_privacy = bidderRequest.uspConsent;
5252
}
5353

54+
const startioEid = request.user?.ext?.eids?.find(eid => eid.source === 'start.io');
55+
if (startioEid?.uids?.[0]?.id) {
56+
request.user.buyeruid = startioEid.uids[0].id;
57+
}
58+
5459
request.bcat = ortb?.bcat || bidParams?.bcat;
5560
request.badv = ortb?.badv || bidParams?.badv;
5661
request.bapp = ortb?.bapp || bidParams?.bapp;

modules/startioBidAdapter.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Maintainer: prebid@start.io
1010

1111
The Start.io Bid Adapter enables publishers to integrate with Start.io's demand sources for banner, video and native ad formats. The adapter supports OpenRTB standards and processes bid requests efficiently using the Prebid.js framework.
1212

13+
# Build
14+
15+
To build Prebid.js with the Start.io User ID submodule and bid adapter, include the following modules:
16+
17+
```bash
18+
gulp build --modules=startioBidAdapter,userId,startioIdSystem,consentManagementTcf,consentManagementGpp,consentManagementUsp,...
19+
```
20+
1321
# Test Parameters
1422
```
1523
var adUnits = [

test/spec/modules/startioBidAdapter_spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,41 @@ describe('Prebid Adapter: Startio', function () {
259259
expect(request.regs.coppa).to.equal(1);
260260
});
261261

262+
it('should set buyeruid from start.io eid', function () {
263+
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
264+
bidderRequest.ortb2 = {
265+
user: {
266+
ext: {
267+
eids: [
268+
{ source: 'start.io', uids: [{ id: 'test-startio-id', atype: 1 }] }
269+
]
270+
}
271+
}
272+
};
273+
274+
const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;
275+
276+
expect(request.user).to.exist;
277+
expect(request.user.buyeruid).to.equal('test-startio-id');
278+
});
279+
280+
it('should not set buyeruid when start.io eid is absent', function () {
281+
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);
282+
bidderRequest.ortb2 = {
283+
user: {
284+
ext: {
285+
eids: [
286+
{ source: 'other.com', uids: [{ id: 'other-id', atype: 1 }] }
287+
]
288+
}
289+
}
290+
};
291+
292+
const request = spec.buildRequests([DEFAULT_REQUEST_DATA], bidderRequest)[0].data;
293+
294+
expect(request.user?.buyeruid).to.not.exist;
295+
});
296+
262297
it('should provide blocked parameters', function () {
263298
let bidRequest = deepClone(DEFAULT_REQUEST_DATA);
264299
let bidderRequest = deepClone(DEFAULT_BIDDER_REQUEST);

0 commit comments

Comments
 (0)