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

[NoQA] Add environment as an identifying property for Fullstory #43194

Merged
merged 5 commits into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 7 additions & 3 deletions src/libs/Fullstory/index.native.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import FullStory, {FSPage} from '@fullstory/react-native';
import type {OnyxEntry} from 'react-native-onyx';
import * as Environment from '@src/libs/Environment/Environment';
import type {UserMetadata} from '@src/types/onyx';

/**
Expand Down Expand Up @@ -40,9 +41,12 @@
// anonymize FullStory user identity metadata
FullStory.anonymize();
} else {
// define FullStory user identity
FullStory.identify(String(metadata.accountID), {
properties: metadata,
Environment.getEnvironment().then((envName: string) => {
// define FullStory user identity
metadata.environment = envName;

Check failure on line 46 in src/libs/Fullstory/index.native.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Assignment to property of function parameter 'metadata'
FullStory.identify(String(metadata.accountID), {
properties: metadata,
});
});
}
},
Expand Down
3 changes: 3 additions & 0 deletions src/libs/Fullstory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
}
FS.onReady().then(() => {
FS.consent(true);
if (value) {
value.environment = envName;

Check failure on line 67 in src/libs/Fullstory/index.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

Assignment to property of function parameter 'value'
}
FS.fsIdentify(value);
});
});
Expand Down
1 change: 1 addition & 0 deletions src/types/onyx/UserMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type UserMetadata = {
role?: string;
freeTrial?: boolean;
accountID?: number;
environment?: string;
};

export default UserMetadata;
Loading