Skip to content

Commit 0eef843

Browse files
authored
feat: Improve & streamline Loader & CDN instructions (#6615)
1 parent 72b018f commit 0eef843

File tree

22 files changed

+377
-242
lines changed

22 files changed

+377
-242
lines changed
Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle: ESM}
22
import * as Sentry from "@sentry/browser";
33
import { CaptureConsole as CaptureConsoleIntegration } from "@sentry/integrations";
44

@@ -14,27 +14,54 @@ Sentry.init({
1414
});
1515
```
1616

17-
```javascript {tabTitle: CDN}
17+
```html {tabTitle: Loader}
1818
<script
19-
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
20-
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
19+
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
20+
crossorigin="anonymous"
21+
></script>
22+
<script
23+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/captureconsole.min.js"
24+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'captureconsole.min.js', 'sha384-base64') }}"
2125
crossorigin="anonymous"
2226
></script>
2327

28+
<script>
29+
Sentry.onLoad(function() {
30+
Sentry.init({
31+
integrations: [new Sentry.Integrations.CaptureConsole(
32+
{
33+
// array of methods that should be captured
34+
// defaults to ['log', 'info', 'warn', 'error', 'debug', 'assert']
35+
levels: string[];
36+
}
37+
)],
38+
});
39+
});
40+
</script>
41+
```
42+
43+
```html {tabTitle: CDN}
44+
<script
45+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js"
46+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}"
47+
crossorigin="anonymous"
48+
></script>
2449
<script
2550
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/captureconsole.min.js"
2651
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'captureconsole.min.js', 'sha384-base64') }}"
2752
crossorigin="anonymous"
2853
></script>
2954

30-
Sentry.init({
31-
dsn: "___PUBLIC_DSN___",
32-
integrations: [new Sentry.Integrations.CaptureConsole(
33-
{
34-
// array of methods that should be captured
35-
// defaults to ['log', 'info', 'warn', 'error', 'debug', 'assert']
36-
levels: string[];
37-
}
38-
)],
39-
});
55+
<script>
56+
Sentry.init({
57+
dsn: "___PUBLIC_DSN___",
58+
integrations: [new Sentry.Integrations.CaptureConsole(
59+
{
60+
// array of methods that should be captured
61+
// defaults to ['log', 'info', 'warn', 'error', 'debug', 'assert']
62+
levels: string[];
63+
}
64+
)],
65+
});
66+
</script>
4067
```
Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle: ESM}
22
import * as Sentry from "@sentry/browser";
33
import { Debug as DebugIntegration } from "@sentry/integrations";
44

@@ -16,29 +16,58 @@ Sentry.init({
1616
});
1717
```
1818

19-
```javascript {tabTitle: CDN}
19+
```html {tabTitle: Loader}
2020
<script
21-
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
22-
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
21+
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
2322
crossorigin="anonymous"
2423
></script>
24+
<script
25+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/debug.min.js"
26+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'debug.min.js', 'sha384-base64') }}"
27+
crossorigin="anonymous"
28+
></script>
29+
30+
<script>
31+
Sentry.onLoad(function() {
32+
Sentry.init({
33+
integrations: [new Sentry.Integrations.Debug(
34+
{
35+
// trigger DevTools debugger instead of using console.log
36+
debugger: boolean;
2537
38+
// stringify event before passing it to console.log
39+
stringify: boolean;
40+
}
41+
)],
42+
});
43+
});
44+
</script>
45+
```
46+
47+
```html {tabTitle: CDN}
48+
<script
49+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js"
50+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}"
51+
crossorigin="anonymous"
52+
></script>
2653
<script
2754
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/debug.min.js"
2855
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'debug.min.js', 'sha384-base64') }}"
2956
crossorigin="anonymous"
3057
></script>
3158

32-
Sentry.init({
33-
dsn: "___PUBLIC_DSN___",
34-
integrations: [new Sentry.Integrations.Debug(
35-
{
36-
// trigger DevTools debugger instead of using console.log
37-
debugger: boolean;
59+
<script>
60+
Sentry.init({
61+
dsn: "___PUBLIC_DSN___",
62+
integrations: [new Sentry.Integrations.Debug(
63+
{
64+
// trigger DevTools debugger instead of using console.log
65+
debugger: boolean;
3866
39-
// stringify event before passing it to console.log
40-
stringify: boolean;
41-
}
42-
)],
43-
});
67+
// stringify event before passing it to console.log
68+
stringify: boolean;
69+
}
70+
)],
71+
});
72+
</script>
4473
```
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle: ESM}
22
import * as Sentry from "@sentry/browser";
33
import { Dedupe as DedupeIntegration } from "@sentry/integrations";
44

@@ -8,21 +8,42 @@ Sentry.init({
88
});
99
```
1010

11-
```javascript {tabTitle: CDN}
11+
```html {tabTitle: Loader}
1212
<script
13-
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
14-
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
13+
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
1514
crossorigin="anonymous"
1615
></script>
16+
<script
17+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/dedupe.min.js"
18+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'dedupe.min.js', 'sha384-base64') }}"
19+
crossorigin="anonymous"
20+
></script>
21+
22+
<script>
23+
Sentry.onLoad(function() {
24+
Sentry.init({
25+
integrations: [new Sentry.Integrations.Dedupe()],
26+
});
27+
});
28+
</script>
29+
```
1730

31+
```html {tabTitle: CDN}
32+
<script
33+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js"
34+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}"
35+
crossorigin="anonymous"
36+
></script>
1837
<script
1938
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/dedupe.min.js"
2039
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'dedupe.min.js', 'sha384-base64') }}"
2140
crossorigin="anonymous"
2241
></script>
2342

24-
Sentry.init({
25-
dsn: "___PUBLIC_DSN___",
26-
integrations: [new Sentry.Integrations.Dedupe()],
27-
});
43+
<script>
44+
Sentry.init({
45+
dsn: "___PUBLIC_DSN___",
46+
integrations: [new Sentry.Integrations.Dedupe()],
47+
});
48+
</script>
2849
```
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle: ESM}
22
import * as Sentry from "@sentry/browser";
33
import { ReportingObserver as ReportingObserverIntegration } from "@sentry/integrations";
44

@@ -8,21 +8,42 @@ Sentry.init({
88
});
99
```
1010

11-
```javascript {tabTitle: CDN}
11+
```html {tabTitle: Loader}
1212
<script
13-
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
14-
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
13+
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
1514
crossorigin="anonymous"
1615
></script>
16+
<script
17+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/reportingobserver.min.js"
18+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'reportingobserver.min.js', 'sha384-base64') }}"
19+
crossorigin="anonymous"
20+
></script>
21+
22+
<script>
23+
Sentry.onLoad(function() {
24+
Sentry.init({
25+
integrations: [new Sentry.Integrations.ReportingObserver()],
26+
});
27+
});
28+
</script>
29+
```
1730

31+
```html {tabTitle: CDN}
32+
<script
33+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js"
34+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}"
35+
crossorigin="anonymous"
36+
></script>
1837
<script
1938
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/reportingobserver.min.js"
2039
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'reportingobserver.min.js', 'sha384-base64') }}"
2140
crossorigin="anonymous"
2241
></script>
2342

24-
Sentry.init({
25-
dsn: "___PUBLIC_DSN___",
26-
integrations: [new Sentry.Integrations.ReportingObserver()],
27-
});
43+
<script>
44+
Sentry.init({
45+
dsn: "___PUBLIC_DSN___",
46+
integrations: [new Sentry.Integrations.ReportingObserver()],
47+
});
48+
</script>
2849
```

src/platform-includes/configuration/enable-pluggable-integrations/node.mdx

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
```javascript {tabTitle: JavaScript}
1+
```javascript {tabTitle: ESM}
22
import * as Sentry from "@sentry/browser";
33
import { ExtraErrorData as ExtraErrorDataIntegration } from "@sentry/integrations";
44

@@ -15,28 +15,56 @@ Sentry.init({
1515
});
1616
```
1717

18-
```javascript {tabTitle: CDN}
18+
```html {tabTitle: Loader}
1919
<script
20-
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
21-
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
20+
src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js"
21+
crossorigin="anonymous"
22+
></script>
23+
<script
24+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/extraerrordata.min.js"
25+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'extraerrordata.min.js', 'sha384-base64') }}"
2226
crossorigin="anonymous"
2327
></script>
2428

29+
<script>
30+
Sentry.onLoad(function() {
31+
Sentry.init({
32+
integrations: [
33+
new Sentry.Integrations.ExtraErrorData({
34+
// Limit of how deep the object serializer should go. Anything deeper than limit will
35+
// be replaced with standard Node.js REPL notation of [Object], [Array], [Function] or
36+
// a primitive value. Defaults to 3.
37+
depth: number,
38+
})
39+
],
40+
});
41+
});
42+
</script>
43+
```
44+
45+
```html {tabTitle: CDN}
46+
<script
47+
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js"
48+
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}"
49+
crossorigin="anonymous"
50+
></script>
2551
<script
2652
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/extraerrordata.min.js"
2753
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'extraerrordata.min.js', 'sha384-base64') }}"
2854
crossorigin="anonymous"
2955
></script>
3056

31-
Sentry.init({
32-
dsn: "___PUBLIC_DSN___",
33-
integrations: [
34-
new Sentry.Integrations.ExtraErrorData({
35-
// Limit of how deep the object serializer should go. Anything deeper than limit will
36-
// be replaced with standard Node.js REPL notation of [Object], [Array], [Function] or
37-
// a primitive value. Defaults to 3.
38-
depth: number,
39-
})
40-
],
41-
});
57+
<script>
58+
Sentry.init({
59+
dsn: "___PUBLIC_DSN___",
60+
integrations: [
61+
new Sentry.Integrations.ExtraErrorData({
62+
// Limit of how deep the object serializer should go. Anything deeper than limit will
63+
// be replaced with standard Node.js REPL notation of [Object], [Array], [Function] or
64+
// a primitive value. Defaults to 3.
65+
depth: number,
66+
})
67+
],
68+
});
69+
</script>
4270
```

0 commit comments

Comments
 (0)