{"_id":"@detatsatrio/react-native-clarity","_rev":"1-4aaab52f875ffb5056155defc116111b","name":"@detatsatrio/react-native-clarity","dist-tags":{"latest":"2.0.2"},"versions":{"2.0.1":{"name":"@detatsatrio/react-native-clarity","version":"2.0.1","description":"A plugin to provide the Clarity experience for the React Native applications.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","release":"release-it","example":"yarn --cwd example","bootstrap":"yarn example && yarn install && yarn example pods","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build *.tgz"},"keywords":["react-native","android"],"repository":{"type":"git","url":"git+https://github.com/microsoft/clarity-apps.git"},"author":{"name":"Microsoft - Clarity","email":"clarity-apps-support@microsoft.com","url":"https://github.com/microsoft/clarity-apps"},"license":"MIT","bugs":{"url":"https://github.com/microsoft/clarity-apps/issues"},"homepage":"https://clarity.microsoft.com/","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@evilmartians/lefthook":"^1.2.2","@commitlint/config-conventional":"^17.0.2","@react-native-community/eslint-config":"^3.0.2","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jest":"^28.1.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"18.2.0","react-native":"0.71.3","react-native-builder-bob":"^0.20.0","release-it":"^15.0.0","typescript":"^4.5.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"engines":{"node":">= 16.0.0"},"packageManager":"^yarn@1.22.15","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"gitHead":"f9edd90f357393335b0ffc3a5c2bf5a5778242e7","_id":"@detatsatrio/react-native-clarity@2.0.1","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-qJ8GuGFLiufaecD+dwglH8CqeoPvH8twaDkc2A7KuQTO5XLqcv+YCXtLNU/ss6nKkjOcXxI9f5SUGjPdvLMZ0w==","shasum":"19419f93302b09a6aebd45eca286ab86b765536f","tarball":"https://registry.npmjs.org/@detatsatrio/react-native-clarity/-/react-native-clarity-2.0.1.tgz","fileCount":18,"unpackedSize":56343,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBB0Co/FmYZZsKqtZ+T+RJ+X0hc70u0eMCJh0Ja70DmFAiEAkVbDsD6yOcilqZ+2K1BrVHqzu0Pp9HmRU7ZAR2aYa4M="}]},"_npmUser":{"name":"detatsatrio","email":"detatsatrio@outlook.com"},"directories":{},"maintainers":[{"name":"detatsatrio","email":"detatsatrio@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-clarity_2.0.1_1700470087164_0.7500091352797289"},"_hasShrinkwrap":false},"2.0.2":{"name":"@detatsatrio/react-native-clarity","version":"2.0.2","description":"A plugin to provide the Clarity experience for the React Native applications.","main":"lib/commonjs/index","module":"lib/module/index","types":"lib/typescript/index.d.ts","react-native":"src/index","source":"src/index","scripts":{"test":"jest","typecheck":"tsc --noEmit","lint":"eslint \"**/*.{js,ts,tsx}\"","release":"release-it","example":"yarn --cwd example","bootstrap":"yarn example && yarn install && yarn example pods","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build *.tgz"},"keywords":["react-native","android"],"repository":{"type":"git","url":"git+https://github.com/microsoft/clarity-apps.git"},"author":{"name":"Microsoft - Clarity","email":"clarity-apps-support@microsoft.com","url":"https://github.com/microsoft/clarity-apps"},"license":"MIT","bugs":{"url":"https://github.com/microsoft/clarity-apps/issues"},"homepage":"https://clarity.microsoft.com/","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@evilmartians/lefthook":"^1.2.2","@commitlint/config-conventional":"^17.0.2","@react-native-community/eslint-config":"^3.0.2","@release-it/conventional-changelog":"^5.0.0","@types/jest":"^28.1.2","@types/react":"~17.0.21","@types/react-native":"0.70.0","commitlint":"^17.0.2","del-cli":"^5.0.0","eslint":"^8.4.1","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jest":"^28.1.1","pod-install":"^0.1.0","prettier":"^2.0.5","react":"18.2.0","react-native":"0.71.3","react-native-builder-bob":"^0.20.0","release-it":"^15.0.0","typescript":"^4.5.2"},"resolutions":{"@types/react":"17.0.21"},"peerDependencies":{"react":"*","react-native":"*"},"engines":{"node":">= 16.0.0"},"packageManager":"^yarn@1.22.15","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native-community","prettier"],"rules":{"prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"gitHead":"5cc8e91cd096fdc9c53121b54f6a045c2f6be068","_id":"@detatsatrio/react-native-clarity@2.0.2","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-8HiWW3CL4innD9he4x8SaVVnImpXLNrAkke7E8k06lgr7pgFKjpww8uilbw2POyBx/kDlj0z8aN1MIAvavk09w==","shasum":"595a2be5e23e5058893d7cb49d58004325d51010","tarball":"https://registry.npmjs.org/@detatsatrio/react-native-clarity/-/react-native-clarity-2.0.2.tgz","fileCount":18,"unpackedSize":56356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7mVBlAPDKXvuGqdCGJA9vrpTxV1le3GVbhcLTaRorAAIgK0iXW6H2QwBtcYFfXcUMRaqabuGqw+aCimc3c1Qacf0="}]},"_npmUser":{"name":"detatsatrio","email":"detatsatrio@outlook.com"},"directories":{},"maintainers":[{"name":"detatsatrio","email":"detatsatrio@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-clarity_2.0.2_1700470321789_0.8686569856545256"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-20T08:48:07.058Z","2.0.1":"2023-11-20T08:48:07.364Z","modified":"2023-11-20T08:52:02.203Z","2.0.2":"2023-11-20T08:52:01.977Z"},"maintainers":[{"name":"detatsatrio","email":"detatsatrio@outlook.com"}],"description":"A plugin to provide the Clarity experience for the React Native applications.","homepage":"https://clarity.microsoft.com/","keywords":["react-native","android"],"repository":{"type":"git","url":"git+https://github.com/microsoft/clarity-apps.git"},"author":{"name":"Microsoft - Clarity","email":"clarity-apps-support@microsoft.com","url":"https://github.com/microsoft/clarity-apps"},"bugs":{"url":"https://github.com/microsoft/clarity-apps/issues"},"license":"MIT","readme":"# react-native-clarity\n\nA ReactNative plugin that allows integrating Clarity with your application.\n\n## Installation\n\n```sh\nnpm install @detatsatrio/react-native-clarity\n```\n\n## Usage\n\n```js\nimport {LogLevel, initialize, setCustomUserId,  setCustomSessionId, setCustomTag, setCurrentScreenName, getCurrentSessionId } from 'react-native-clarity';\n\n// Initialize Clarity.\nlet clarityConfig = {\n  logLevel: LogLevel.Verbose,\n  allowMeteredNetworkUsage: true\n}\n\ninitialize('<ProjectId>', clarityConfig);\n\n// Set custom user id.\nsetCustomUserId(\"<CustomUserId>\");\n\n// Set custom session id.\nsetCustomSessionId(\"<CustomSessionId>\");\n\n// Set custom tag.\nsetCustomTag(\"key\", \"value\");\n\n// Setting the current screen name when using React Navigation\nimport { ..., useFocusEffect } from '@react-navigation/native';\n\nconst HomeScreen = ({...}) => {\n  useFocusEffect(\n    React.useCallback(() => {\n      setCurrentScreenName(\"Home\");\n\n      // To clear the current screen name when the screen goes out of focus:\n      return () => { setCurrentScreenName(undefined); }\n    }, [])\n  );\n  ...\n};\n\n// Get current session id to correlate with other tools.\ngetCurrentSessionId().then((id) => {...});\n```\n\n### Initialization arguments\n\n```ts\n/**\n * Initializes the Clarity SDK if the API level is supported.\n * \n * @param projectId     [REQUIRED] The Clarity project id to send data to.\n * @param config     [OPTIONAL] The clarity config, if not provided default values are used.\n*/\nfunction initialize(projectId: string, config?: ClarityConfig) \n\n/**\n * The configuration that will be used to customize the Clarity behaviour.\n * \n * @param userId        [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id\n *                      will be auto generated. The user id in general is sticky across sessions.\n *                      The provided user id must follow these conditions:\n *                          1. Cannot be an empty string.\n *                          2. Should be base36 and smaller than \"1Z141Z4\".\n * @param logLevel      [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.\n * @param allowMeteredNetworkUsage  [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.\n * @param enableWebViewCapture    [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.\n * @param allowedDomains    [OPTIONAL default = [\"*\"]] The whitelisted domains to allow Clarity to capture their DOM content.\n *                          If it contains \"*\" as an element, all domains will be captured.\n * @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.\n */\n\ninterface ClarityConfig {\n  userId?: string | null;\n  logLevel?: LogLevel;\n  allowMeteredNetworkUsage?: boolean;\n  enableWebViewCapture?: boolean;\n  allowedDomains?: string[];\n  disableOnLowEndDevices?: Boolean;\n}\n```\n\n## License\n\nMIT","readmeFilename":"README.md"}