Skip to content

Commit 051d6fb

Browse files
authored
Merge pull request #251 from GleapSDK/feat/stop-network-logger
feat: Gleap.stopNetworkLogger, and network logs off in the dashboard means off
2 parents 3ccf766 + 88bffda commit 051d6fb

32 files changed

Lines changed: 3118 additions & 121 deletions

‎CHANGELOG.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 19.10.0
4+
5+
### Breaking changes
6+
- With **Network logs** off in the dashboard (also in a project that never set it), tickets no longer contain Resource Timing entries (request URLs). Turn the setting on or call `Gleap.startNetworkLogger()` before `Gleap.initialize()` to keep them. ([#251](https://github.com/GleapSDK/JavaScript-SDK/pull/251))
7+
- Turning **Network logs** off also stops a running logger, restores `fetch` and `XMLHttpRequest`, and deletes its logs, unless the app called `Gleap.startNetworkLogger()`. ([#251](https://github.com/GleapSDK/JavaScript-SDK/pull/251))
8+
- Resource Timing entries are left out until the project's settings are loaded. ([#251](https://github.com/GleapSDK/JavaScript-SDK/pull/251))
9+
- `Gleap.destroy()` stops the network logger. Its logs are held back until the next `Gleap.initialize()` loads the settings. ([#251](https://github.com/GleapSDK/JavaScript-SDK/pull/251))
10+
11+
### Added
12+
- `Gleap.stopNetworkLogger()` turns network logging off, whatever the dashboard says. Call it before `Gleap.initialize()` to send no network data at all. ([#251](https://github.com/GleapSDK/JavaScript-SDK/pull/251))
13+
314
## 19.9.2
415

516
### Breaking changes

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ When the grant runs out and no fresh token arrives (no `setUserJwt` on this page
100100

101101
Older integrations that pass a user hash to `Gleap.identify(userId, data, userHash)` keep working while "Accept legacy user hash" is on for the project; see [Upgrade to identity tokens](https://docs.gleap.ai/en/articles/16752008-upgrade-to-identity-tokens) to move them to `Gleap.setUserJwt`. `Gleap.identify(userId, data)` without a hash creates an unsigned contact.
102102

103+
### Network logs (optional)
104+
105+
Network logs follow the **Network logs** setting in the dashboard. To keep all network data out of Gleap, whatever the dashboard says, stop the logger before you initialize the SDK:
106+
107+
```
108+
Gleap.stopNetworkLogger();
109+
Gleap.initialize("YOUR_PROJECT_ID");
110+
```
111+
112+
After the call, no requests are logged, no Resource Timing entries are read and logs from `Gleap.attachNetworkLogs` are left out. `Gleap.startNetworkLogger()` turns logging on again, whatever the dashboard says; logs attached before that have to be attached again.
113+
103114
### Dark mode (optional)
104115

105116
The widget can match your app's dark/light mode. Enable "Adapt to dark / light mode" in the dashboard (Widget → Look & feel) and set the dark colors there: header colors, UI color and background. In dark mode the widget uses these dark colors, plus the dark logo, header image and composer glow set in the dashboard; without dark colors it keeps its normal colors. Override the scheme at runtime, e.g. from your own theme toggle (only takes effect while "Adapt to dark / light mode" is enabled in the dashboard; until you call it, the dashboard setting applies):

‎build/browser/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/browser/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/cjs/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/cjs/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/esm/index.mjs‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎build/esm/index.mjs.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎index.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ export namespace Gleap {
125125
*/
126126
function setAgentConversationUrl(agentConversationUrl: string): void;
127127
function setMaxNetworkRequests(maxRequests: number): void;
128+
/** Starts logging network requests, also when **Network logs** is off in the dashboard. */
128129
function startNetworkLogger(): void;
130+
/**
131+
* Stops network logging until startNetworkLogger is called, whatever the dashboard says. Deletes
132+
* what was logged and sends no network data, attached logs included (attach them again after a restart). Can be called before initialize.
133+
*/
134+
function stopNetworkLogger(): void;
129135
function setNetworkLogsBlacklist(networkLogBlacklist: string[]): void;
130136
function setNetworkLogPropsToIgnore(filters: string[]): void;
131137
/**

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)