Skip to content

Commit f8e8898

Browse files
committed
add profile context
1 parent 547d517 commit f8e8898

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/browser-utils/src/metrics/inp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function _trackINP(): () => void {
9393
const replayId = replay && replay.getReplayId();
9494

9595
const userDisplay = user !== undefined ? user.email || user.id || user.ip_address : undefined;
96-
let profileId = undefined;
96+
let profileId: string | undefined = undefined;
9797
try {
9898
// @ts-expect-error skip optional chaining to save bundle size with try catch
9999
profileId = scope.getScopeData().contexts.profile.profile_id;

packages/types/src/context.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface Contexts extends Record<string, Context | undefined> {
1212
trace?: TraceContext;
1313
cloud_resource?: CloudResourceContext;
1414
state?: StateContext;
15+
profile?: ProfileContext;
1516
}
1617

1718
export interface StateContext extends Record<string, unknown> {
@@ -114,3 +115,7 @@ export interface CloudResourceContext extends Record<string, unknown> {
114115
['host.id']?: string;
115116
['host.type']?: string;
116117
}
118+
119+
export interface ProfileContext extends Record<string, unknown> {
120+
profile_id: string;
121+
}

0 commit comments

Comments
 (0)