Skip to content

Commit 1d6c22d

Browse files
authored
Add bundled analytics support in Inspector (#616)
1 parent 3367f39 commit 1d6c22d

File tree

4 files changed

+586
-17
lines changed

4 files changed

+586
-17
lines changed

.changeset/serious-shirts-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-next': minor
3+
---
4+
5+
Bundled analytics support in Inspector

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
},
6262
"devDependencies": {
6363
"@internal/config": "0.0.0",
64-
"@segment/inspector-webext": "^1.1.0",
64+
"@segment/inspector-webext": "^2.0.3",
6565
"@size-limit/preset-big-lib": "^7.0.8",
6666
"@types/flat": "^5.0.1",
6767
"@types/fs-extra": "^9.0.2",

packages/browser/src/browser/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
flushOn,
2424
} from '../core/buffer'
2525
import { popSnippetWindowBuffer } from '../core/buffer/snippet'
26+
import { inspectorHost } from '../core/inspector'
2627

2728
export interface LegacyIntegrationConfiguration {
2829
/* @deprecated - This does not indicate browser types anymore */
@@ -270,6 +271,8 @@ async function loadAnalytics(
270271
const opts: InitOptions = { retryQueue, ...options }
271272
const analytics = new Analytics(settings, opts)
272273

274+
inspectorHost.attach?.(analytics as any)
275+
273276
const plugins = settings.plugins ?? []
274277
Context.initMetrics(legacySettings.metrics)
275278

0 commit comments

Comments
 (0)