|
| 1 | +<SignInNote /> |
| 2 | + |
| 3 | +```javascript {tabTitle: ESM} |
| 4 | +import * as Sentry from "@sentry/browser"; |
| 5 | +import { ContextLines } from "@sentry/integrations"; |
| 6 | + |
| 7 | +Sentry.init({ |
| 8 | + dsn: "___PUBLIC_DSN___", |
| 9 | + integrations: [ |
| 10 | + new ContextLines({ |
| 11 | + // The number of lines to collect around each stack frame's line number |
| 12 | + // Defaults to 7 |
| 13 | + frameContextLines: 7, |
| 14 | + }), |
| 15 | + ], |
| 16 | +}); |
| 17 | +``` |
| 18 | + |
| 19 | +```html {tabTitle: Loader} |
| 20 | +<script |
| 21 | + src="https://js.sentry-cdn.com/___PUBLIC_KEY___.min.js" |
| 22 | + crossorigin="anonymous" |
| 23 | +></script> |
| 24 | +<script |
| 25 | + src="https://browser.sentry-cdn.com/{{@inject packages.version('sentry.javascript.browser') }}/contextlines.min.js" |
| 26 | + integrity="sha384-{{@inject packages.checksum('sentry.javascript.browser', 'contextlines.min.js', 'sha384-base64') }}" |
| 27 | + crossorigin="anonymous" |
| 28 | +></script> |
| 29 | + |
| 30 | +<script> |
| 31 | + Sentry.onLoad(function () { |
| 32 | + Sentry.init({ |
| 33 | + integrations: [ |
| 34 | + new Sentry.Integrations.ContextLines({ |
| 35 | + // The number of lines to collect before and after each stack frame's line number |
| 36 | + // Defaults to 7 |
| 37 | + frameContextLines: 7, |
| 38 | + }), |
| 39 | + ], |
| 40 | + }); |
| 41 | + }); |
| 42 | +</script> |
| 43 | +``` |
| 44 | + |
| 45 | +```html {tabTitle: CDN} |
| 46 | +<script |
| 47 | + src="https://browser.sentry-cdn.com/{{@inject packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js" |
| 48 | + integrity="sha384-{{@inject packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}" |
| 49 | + crossorigin="anonymous" |
| 50 | +></script> |
| 51 | +<script |
| 52 | + src="https://browser.sentry-cdn.com/{{@inject packages.version('sentry.javascript.browser') }}/contextlines.min.js" |
| 53 | + integrity="sha384-{{@inject packages.checksum('sentry.javascript.browser', 'contextlines.min.js', 'sha384-base64') }}" |
| 54 | + crossorigin="anonymous" |
| 55 | +></script> |
| 56 | + |
| 57 | +<script> |
| 58 | + Sentry.init({ |
| 59 | + dsn: "___PUBLIC_DSN___", |
| 60 | + integrations: [ |
| 61 | + new Sentry.Integrations.ContextLines({ |
| 62 | + // The number of lines to collect around each stack frame's line number |
| 63 | + // Defaults to 7 |
| 64 | + frameContextLines: 7, |
| 65 | + }), |
| 66 | + ], |
| 67 | + }); |
| 68 | +</script> |
| 69 | +``` |
0 commit comments