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 @@ -63,10 +63,28 @@ rewrite_scripts = true
6363prefix = " /permutive/api"
6464target = " https://api.permutive.com"
6565methods = [" GET" , " POST" ]
66- description = " Permutive API"
66+ description = " Permutive API - Configuration & segment updates "
6767
6868[[proxy_mappings ]]
6969prefix = " /permutive/secure-signal"
7070target = " https://secure-signals.permutive.app"
7171methods = [" GET" , " POST" ]
7272description = " Permutive Secure Signals"
73+
74+ [[proxy_mappings ]]
75+ prefix = " /permutive/events"
76+ target = " https://events.permutive.app"
77+ methods = [" GET" , " POST" ]
78+ description = " Permutive Events - Event collection endpoint"
79+
80+ [[proxy_mappings ]]
81+ prefix = " /permutive/sync"
82+ target = " https://sync.permutive.com"
83+ methods = [" GET" , " POST" ]
84+ description = " Permutive Sync - Identity synchronization"
85+
86+ [[proxy_mappings ]]
87+ prefix = " /permutive/cdn"
88+ target = " https://cdn.permutive.com"
89+ methods = [" GET" ]
90+ description = " Permutive CDN - Static assets"
You can’t perform that action at this time.
0 commit comments