File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,40 @@ analytics
84
84
.catch ((err ) => ... );
85
85
```
86
86
87
+ ## Custom CDN / API Proxy
88
+
89
+ You can proxy settings and destination requests that typically go to ` http://cdn.segment.com ` through a custom proxy.
90
+ ``` ts
91
+ const analytics = AnalyticsBrowser .load ({
92
+ writeKey ,
93
+ // GET http://cdn.segment.com/v1/projects/<writekey>/settings ->
94
+ // https://MY-CUSTOM-CDN-PROXY.com/v1/project/<writekey>/settings
95
+
96
+ // GET https://cdn.segment.com/next-integrations/actions/...js ->
97
+ // https://MY-CUSTOM-CDN-PROXY.com/next-integrations/actions/...js
98
+ cdnURL: ' https://MY-CUSTOM-CDN-PROXY.com' // 🔥
99
+ })
100
+ ```
101
+
102
+ You can proxy event calls that typically go to ` https://api.segment.io ` by configuring ` integrations['Segment.io'].apiHost ` .
103
+ ``` ts
104
+ const analytics = AnalyticsBrowser .load (
105
+ {
106
+ writeKey ,
107
+ cdnURL: ' https://MY-CUSTOM-CDN-PROXY.com'
108
+ },
109
+ {
110
+ integrations: {
111
+ ' Segment.io' : {
112
+ // POST https://api.segment.io/v1/t ->
113
+ // https://MY-CUSTOM-API-PROXY.com/v1/t
114
+ apiHost: ' MY-CUSTOM-API-PROXY.com' // 🔥
115
+ }
116
+ }
117
+ }
118
+ )
119
+ ```
120
+
87
121
## Usage in Common Frameworks
88
122
### React
89
123
``` tsx
You can’t perform that action at this time.
0 commit comments