-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Reporting - adding session replay for web #2870
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5d1ea30
Error Reporting - adding session replay for web
peter-shao 85d0e81
Merge branch 'main' into peter/session-replay
peter-shao e17bde0
Modifications for clarity of session replay
peter-shao 23b124b
Merge branch 'main' into peter/session-replay
rick-bt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
docs/error-reporting/platform-integrations/session-replay.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,65 @@ | ||||||
--- | ||||||
id: session-replay | ||||||
title: Session Replay for Web | ||||||
sidebar_label: Session Replay | ||||||
description: Configure session replay in your web applications. | ||||||
--- | ||||||
|
||||||
import Tabs from '@theme/Tabs'; | ||||||
import TabItem from '@theme/TabItem'; | ||||||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||||||
|
||||||
:::note | ||||||
|
||||||
Session Replay is currently in beta and only available for web applications. Replays are limited during this phase. | ||||||
|
||||||
::: | ||||||
|
||||||
Session Replay allows you to capture a visual recreation of user sessions. This simplifies the replication of user errors to determine the root cause. Combining session replays with breadcrumbs and callstacks can give a complete view of the user experience. | ||||||
|
||||||
## Overview of Session Replay | ||||||
Session replay works by capturing the DOM state periodically when the user interacts wtih your application. The user session is then recreated when viewing the error in Backtrace. Unlike a video recording, these packages are lightweight and allow for additional processing prior to being sent and stored in Backtrace (i.e. masking for PII considerations). Currently, Backtrace SDK will snip the session around a triggering error, allowing your team to hone in on specific issues. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
The Backtrace implementation makes use of [rrweb](https://github.com/rrweb-io/rrweb/blob/master/guide.md). | ||||||
|
||||||
## Prerequisites | ||||||
- A Backtrace account ([log in](https://backtrace.io/login) or sign up for a [free trial license](https://backtrace.io/sign-up)). | ||||||
- Follow the ([JavaScript integration guide](https://docs.saucelabs.com/error-reporting/language-integrations/javascript/)). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
## Setting Up Session Replay | ||||||
|
||||||
### Install the package | ||||||
```bash | ||||||
npm install @backtrace/session-replay | ||||||
``` | ||||||
### Integrate the session replay module | ||||||
|
||||||
Add the following code to the build the session replay module: | ||||||
|
||||||
```javascript | ||||||
import { BacktraceClient, BacktraceConfiguration } from '@backtrace/browser'; | ||||||
import { BacktraceSessionReplayModule } from '@backtrace/session-replay'; | ||||||
|
||||||
// Configure client options | ||||||
const options: BacktraceConfiguration = { | ||||||
// Name of the website/application | ||||||
name: 'MyWebPage', | ||||||
// Version of the website | ||||||
version: '1.2.3', | ||||||
// Submission url | ||||||
// <universe> is the subdomain of your Backtrace instance (<universe>.backtrace.io) | ||||||
// <token> can be found in Project Settings/Submission tokens | ||||||
url: 'https://submit.backtrace.io/<universe>/<token>/json', | ||||||
}; | ||||||
|
||||||
// Initialize the client with the options | ||||||
// Make sure to add `useModule` with `BacktraceSessionReplayModule` | ||||||
const client = BacktraceClient.builder(options) | ||||||
.useModule( | ||||||
new BacktraceSessionReplayModule({ | ||||||
maxEventCount: 100, | ||||||
}), | ||||||
) | ||||||
.build(); | ||||||
``` | ||||||
Additional options for event limiting, masking, privacy, and more can be found on [Backtrace github](https://github.com/backtrace-labs/backtrace-javascript/tree/main/packages/session-replay). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.