Skip to content

Commit c81a387

Browse files
committed
add js package codeblock demo
1 parent f04abe7 commit c81a387

File tree

15 files changed

+58
-240
lines changed

15 files changed

+58
-240
lines changed

docs/platforms/javascript/common/session-replay/index.mdx

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,62 @@ There is currently no PII scrubbing in canvas recordings!
6262

6363
If you want to record HTML canvas elements, you'll need to add an additional integration in your Sentry configuration. The canvas integration is exported from the browser SDK, so no additional package is required. Canvas recording is opt-in and will be tree-shaken from your bundle if it's not being used:
6464

65-
<PlatformContent includePath="session-replay/setup-canvas" />
65+
<PlatformSection notSupported={["javascript"]}>
66+
```javascript {13}
67+
import * as Sentry from "___JS_PACKAGE___";
68+
69+
Sentry.init({
70+
dsn: "___PUBLIC_DSN___",
71+
replaysSessionSampleRate: 0.1,
72+
replaysOnErrorSampleRate: 1.0,
73+
74+
integrations: [
75+
// Keep the Replay integration as before
76+
Sentry.replayIntegration(),
77+
78+
// The following is all you need to enable canvas recording with Replay
79+
Sentry.replayCanvasIntegration(),
80+
],
81+
});
82+
```
83+
</PlatformSection>
84+
85+
<PlatformSection supported={["javascript"]}>
86+
```javascript {tabTitle: npm} {13}
87+
import * as Sentry from "___JS_PACKAGE___";
88+
89+
Sentry.init({
90+
dsn: "___PUBLIC_DSN___",
91+
replaysSessionSampleRate: 0.1,
92+
replaysOnErrorSampleRate: 1.0,
93+
94+
integrations: [
95+
// Keep the Replay integration as before
96+
Sentry.replayIntegration(),
97+
98+
// The following is all you need to enable canvas recording with Replay
99+
Sentry.replayCanvasIntegration(),
100+
],
101+
});
102+
```
103+
104+
```html {tabTitle: CDN}
105+
<!-- Existing script tag for bundle with replay, error, and tracing -->
106+
<script
107+
src="https://browser.sentry-cdn.com/{{@inject packages.version('sentry.javascript.browser') }}/bundle.tracing.replay.min.js"
108+
integrity="sha384-{{@inject packages.checksum('sentry.javascript.browser', 'bundle.tracing.replay.min.js', 'sha384-base64') }}"
109+
crossorigin="anonymous"
110+
></script>
111+
112+
<!-- New script tag for the canvas replay integration -->
113+
<script
114+
src="https://browser.sentry-cdn.com/{{@inject packages.version('sentry.javascript.browser') }}/replay-canvas.min.js"
115+
integrity="sha384-{{@inject packages.checksum('sentry.javascript.browser', 'replay-canvas.min.js', 'sha384-base64') }}"
116+
crossorigin="anonymous"
117+
></script>
118+
```
119+
</PlatformSection>
120+
66121

67122
#### 3D and WebGL Canvases
68123

docs/platforms/javascript/guides/aws-lambda/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: AWS Lambda
33
description: "Learn about Sentry's integration with AWS Lambda."
4-
sdk: sentry.javascript.node
4+
sdk: sentry.javascript.aws-serverless
55
fallbackGuide: javascript.node
66
categories:
77
- serverless

docs/platforms/javascript/guides/gcp-functions/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Google Cloud Functions
33
description: "Learn how to use Sentry's Google Cloud Functions SDK."
4-
sdk: sentry.javascript.node
4+
sdk: sentry.javascript.google-cloud-serverless
55
fallbackGuide: javascript.node
66
categories:
77
- serverless

platform-includes/session-replay/setup-canvas/javascript.angular.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.astro.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.ember.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.gatsby.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.mdx

Lines changed: 0 additions & 34 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.nextjs.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

platform-includes/session-replay/setup-canvas/javascript.nuxt.mdx

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)