File tree Expand file tree Collapse file tree 2 files changed +36
-4
lines changed
Expand file tree Collapse file tree 2 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,25 @@ declare const permutive: {
4444} ;
4545
4646export function installPermutiveShim ( ) {
47+ log . info ( 'Installing Permutive shim - rewriting API hosts to first-party domain' ) ;
4748
49+ const host = window . location . host ;
50+ const protocol = window . location . protocol === "https:" ? "https" : "http" ;
4851
52+ permutive . config . apiHost = host + '/permutive/api' ;
53+ permutive . config . apiProtocol = protocol ;
4954
50- permutive . config . apiHost = window . location . host + '/permutive/api' ;
51- permutive . config . apiProtocol = window . location . protocol === "https:" ? "https" : "http" ;
55+ permutive . config . secureSignalsApiHost = host + '/permutive/secure-signal' ;
5256
53- permutive . config . secureSignalsApiHost = window . location . host + '/permutive/secure-signal' ;
57+ permutive . config . segmentSyncApiHost = host + '/permutive/sync' ;
58+
59+ permutive . config . cdnBaseUrl = host + '/permutive/cdn' ;
60+ permutive . config . cdnProtocol = protocol ;
61+
62+ log . info ( 'Permutive shim installed' , {
63+ apiHost : permutive . config . apiHost ,
64+ secureSignalsApiHost : permutive . config . secureSignalsApiHost ,
65+ segmentSyncApiHost : permutive . config . segmentSyncApiHost ,
66+ cdnBaseUrl : permutive . config . cdnBaseUrl ,
67+ } ) ;
5468}
Original file line number Diff line number Diff line change @@ -47,10 +47,28 @@ X-Custom-Header = "custom header value"
4747prefix = " /permutive/api"
4848target = " https://api.permutive.com"
4949methods = [" GET" , " POST" ]
50- description = " Permutive API"
50+ description = " Permutive API - Configuration & segment updates "
5151
5252[[proxy_mappings ]]
5353prefix = " /permutive/secure-signal"
5454target = " https://secure-signals.permutive.app"
5555methods = [" GET" , " POST" ]
5656description = " Permutive Secure Signals"
57+
58+ [[proxy_mappings ]]
59+ prefix = " /permutive/events"
60+ target = " https://events.permutive.app"
61+ methods = [" GET" , " POST" ]
62+ description = " Permutive Events - Event collection endpoint"
63+
64+ [[proxy_mappings ]]
65+ prefix = " /permutive/sync"
66+ target = " https://sync.permutive.com"
67+ methods = [" GET" , " POST" ]
68+ description = " Permutive Sync - Identity synchronization"
69+
70+ [[proxy_mappings ]]
71+ prefix = " /permutive/cdn"
72+ target = " https://cdn.permutive.com"
73+ methods = [" GET" ]
74+ description = " Permutive CDN - Static assets"
You can’t perform that action at this time.
0 commit comments