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

Add bundled analytics support in Inspector #616

Merged
merged 1 commit into from
Oct 16, 2022
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
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