Skip to content

Commit

Permalink
Add bundled analytics support in Inspector (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
zikaari authored Oct 16, 2022
1 parent 3367f39 commit 1d6c22d
Show file tree
Hide file tree
Showing 4 changed files with 586 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-shirts-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-next': minor
---

Bundled analytics support in Inspector
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"devDependencies": {
"@internal/config": "0.0.0",
"@segment/inspector-webext": "^1.1.0",
"@segment/inspector-webext": "^2.0.3",
"@size-limit/preset-big-lib": "^7.0.8",
"@types/flat": "^5.0.1",
"@types/fs-extra": "^9.0.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/browser/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
flushOn,
} from '../core/buffer'
import { popSnippetWindowBuffer } from '../core/buffer/snippet'
import { inspectorHost } from '../core/inspector'

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

inspectorHost.attach?.(analytics as any)

const plugins = settings.plugins ?? []
Context.initMetrics(legacySettings.metrics)

Expand Down
Loading

0 comments on commit 1d6c22d

Please sign in to comment.