Skip to content

Commit c426769

Browse files
committed
wip
1 parent 1ec7fa7 commit c426769

File tree

1 file changed

+6
-5
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+6
-5
lines changed

src/connections/sources/catalog/libraries/website/javascript/custom-proxy.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,23 @@ To add a CNAME record to your DNS settings:
172172
4. Run `curl` on your domain to check if the proxy is working correctly.
173173

174174

175-
## Self-Hosting Analytics.js
176-
Sometimes, users want to host as much as Segment on their own infrastructure as possible, for control or to minimize network calls.
175+
## Self-Hosting Analytics.js, settings, and destinations
176+
To reduce or eliminate fetching assets from Segment's CDN, you can bundle analytics.js with your own code.
177+
177178

178179
Some things you can do:
179180
1. Use [Analytics.js as an npm package](https://github.com/segmentio/analytics-next/tree/master/packages/browser#-using-as-an-npm-package).
180181

181-
2. Use [npm to bundle your destinations ](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#add-destinations-from-npm) with your own code instead of fetching them from the CDN.
182+
2. Use [npm to bundle your destinations ](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#add-destinations-from-npm) with your own code instead of fetching them from the CDN (advanced optimization -- this is generally not neccessary).
182183

183184

184-
3. Hardcode your settings instead of fetching from the CDN (Not recommended; this bypasses the Segment GUI completely).
185+
3. Hardcode your settings instead of fetching from the CDN (not recommended -- bypass the Segment souce configuration GUI completely).
185186
```ts
186187
// npm-only
187188
export const analytics = new AnalyticsBrowser()
188189
analytics.load({
189190
...
190-
cdnSettings: 'Paste object from https://cdn.segment.com/v1/projects/<YOUR_WRITE_KEY>/settings'
191+
cdnSettings: {...} // object from https://cdn.segment.com/v1/projects/<YOUR_WRITE_KEY>/settings'
191192
})
192193
```
193194

0 commit comments

Comments
 (0)