File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# NewsPassID
22
3- A first-party identity and targeting solution for publishers.
3+ First-Party Identity and Targeting Solution for Publishers
44
55## Features
66
7- - Simple, one-line implementation for publishers
8- - Privacy-compliant with IAB GPP API integration
9- - Automatic ad targeting with first-party segments
10- - High-entropy ID generation supporting 500M+ unique visitors
7+ - First-party ID generation and management
8+ - Segment-based targeting
9+ - GPP consent integration
10+ - Meta tag injection for segments
11+ - Publisher-specific namespace support
12+ - GDPR and CCPA compliant
13+ - Lightweight and fast implementation
1114- Seamless integration with Google Ad Manager and other ad platforms
1215
1316## Quick Start
Original file line number Diff line number Diff line change 1+ import { generateId } from '../../src/utils/random' ;
2+
3+ describe ( 'Random ID Generation' , ( ) => {
4+ test ( 'should generate unique IDs with sufficient entropy' , ( ) => {
5+ const namespace = 'test' ;
6+ const iterations = 1000 ;
7+ const generatedIds = new Set < string > ( ) ;
8+
9+ // Generate multiple IDs and check for uniqueness
10+ for ( let i = 0 ; i < iterations ; i ++ ) {
11+ const id = generateId ( namespace ) ;
12+ expect ( id ) . toMatch ( / ^ t e s t - [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - 4 [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } $ / ) ;
13+ expect ( generatedIds . has ( id ) ) . toBe ( false ) ;
14+ generatedIds . add ( id ) ;
15+ }
16+
17+ // Verify we got the expected number of unique IDs
18+ expect ( generatedIds . size ) . toBe ( iterations ) ;
19+ } ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments