Skip to content
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

Pick changes #113

Merged
merged 6 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pages/en/installation/canvas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metaDescription: "How to record canvas and WebGL elements in session replay."

OpenReplay can record the content of `<canvas>` elements with support for WebGL.

> Note: if you're using WebGL context, make sure you're adding `{ preserveDrawingBuffer: true }` to .getContext options to prevent blank frames, since extracting image data from canvas usually relies on drawing layer that's omitted by default.

## Enable Canvas Recording

To enable canvas recording, simply run `openreplay -e` then add the below block to update the `http` service.
Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/rn-sdk/modules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface IORTrackerConnector {
- [setMetadata()](/rn-sdk/set-metadata): Set a metadata field and save it as part of the recording.
- [event()](/rn-sdk/event): Send custom events to be recorded as part of your replays with this method.
- [setUserID()](/rn-sdk/set-user-id): Identify your users with this method.

- [patchNetwork()](/rn-sdk/patch-network): Patch fetch or/and XMLHttpRequest to record network requests.
## Components

- [ORTouchTrackingView](/rn-sdk/touch): View used to track touch events.
Expand Down
34 changes: 34 additions & 0 deletions src/pages/en/rn-sdk/patch-network.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "React Native SDK - patchNetwork method"
metaTitle: "React Native SDK - patchNetwork method"
metaDescription: "Details about the patchNetwork method from OpenReplay's React Native SDK"
---

This method patches XHR and Fetch apis to intercept network requests.

## Signature

```js
import OR from '@openreplay/react-native'

OR.tracker.patchNetwork(
global,
(url) => url.includes('openreplaydomain'),
{ mode: 'fetch' }
)
```

## Parameters

- `context: globalThis`: current context of the app (to get fetch/xhr from)
- `isServiceURL: (url: string) => boolean`: function that checks if current request should be tracked (false) or skipped (true)
- `options: Partial<Options>`: options object

## Options

- `ignoreHeaders: Array<string> | boolean`: headers to ignore (default: `['cookie', 'set-cookie', 'authorization']`)
- `capturePayload: boolean`: whether to capture request payload (default: `false`)
- `sanitizer: data: RequestResponseData) => RequestResponseData`: function that sanitizes request/response (default: `undefined`)
- `mode: 'fetch' | 'xhr' | 'all'`: which api to patch (default: `'fetch'`)

> Note: React-Native fetch are using XHR under the hood (at the moment of writing), so using "all" can lead to duplicated requests in the recording
2 changes: 1 addition & 1 deletion src/pages/en/sdk/constructor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ There are a set of options you can pass to the constructor. Only `projectKey` is
- `disableClickmaps?: boolean` For disabling click maps. Default: `true`.
- `verbose?: boolean` For enabling logs. Default: `false`.
- `autoResetOnWindowOpen?: boolean` Enable this option to reset the sessionID when opening a new tab from your application. This overwrites the `window.open` method to avoid duplicate sessionIDs due to shared session storage between browser tabs. Default: `false`.
- `forceSingleTab: boolean` Disables multi-tab recording capabilities. Default: `false`.
- `forceSingleTab: boolean` Disables the multi-tab recording capability which stitches user sessions, conducted across multiple tabs, into a single replay. Instead, by enabling this option, sessions captured in different browser tabs will be recorded in separate recordings. Default: `false`.
- `disableStringDict: boolean` Disables the string dictionary logic (for optimizing storage) in recordings. Default: `false`.

### Privacy
Expand Down
Loading