{"_id":"@amplitude/plugin-user-agent-enrichment-browser","_rev":"21-3cd384fd4867f29314c52fd968006fdd","name":"@amplitude/plugin-user-agent-enrichment-browser","dist-tags":{"v1-beta":"1.0.0-beta.1","latest":"1.0.1"},"versions":{"0.1.0":{"name":"@amplitude/plugin-user-agent-enrichment-browser","version":"0.1.0","author":{"name":"Amplitude Inc"},"license":"MIT","_id":"@amplitude/plugin-user-agent-enrichment-browser@0.1.0","maintainers":[{"name":"alec.amplitude","email":"alec.boutin@amplitude.com"},{"name":"amplicynthia","email":"cynthia.li@amplitude.com"},{"name":"mae.capozzi","email":"mae.capozzi@amplitude.com"},{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},{"name":"dnshi","email":"dean.xiaoshi@gmail.com"},{"name":"kevinpagtakhan","email":"kevpagtakhan@gmail.com"},{"name":"justin-fiedler","email":"jbfiedler@gmail.com"},{"name":"qingzhuo","email":"qingzhuo.zhen@amplitude.com"},{"name":"rctbusk","email":"rctbusk@gmail.com"},{"name":"jackmccloy","email":"dryice82@gmail.com"},{"name":"amp_haoliu","email":"hao.liu@amplitude.com"},{"name":"myztiq","email":"npm@ryan-kahn.com"},{"name":"curtisbliu","email":"curtis@amplitude.com"},{"name":"jtran","email":"jptran318@gmail.com"},{"name":"kelvin-lu","email":"kelvin@amplitude.com"},{"name":"nutwani","email":"nirmal@amplitude.com"},{"name":"hao.yu","email":"hao.yu@amplitude.com"},{"name":"kelson.warner","email":"kelson.warner@amplitude.com"},{"name":"ajhorst_amp","email":"aj.horst@amplitude.com"},{"name":"brian.giori","email":"brian.giori@amplitude.com"}],"homepage":"https://github.com/amplitude/Amplitude-TypeScript","bugs":{"url":"https://github.com/amplitude/Amplitude-TypeScript/issues"},"dist":{"shasum":"a5aa0cf131c11ed4f43d23f942861bfadc5287c6","tarball":"https://registry.npmjs.org/@amplitude/plugin-user-agent-enrichment-browser/-/plugin-user-agent-enrichment-browser-0.1.0.tgz","fileCount":37,"integrity":"sha512-Ouggh+uF7fc+YV1a6uFXDpQVCKjznrVt3jBC0xahOOb5mvVOHEKdIKIJRSlIpLMOdXler7BSrLpr3iTVH/EXNA==","signatures":[{"sig":"MEUCIQDGX5nZWIuvQmMwEeNZ3K+Nmxa4vod2zPCqnzEMnWhwWgIgCx9aPTwlF7peqpxCCzIVjxknyrbR2oHU5ulE45fTgcE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76717},"main":"lib/cjs/index.js","types":"lib/esm/index.d.ts","module":"lib/esm/index.js","gitHead":"6d9cf5f1a05293815917f2136914493a67a9256f","scripts":{"fix":"yarn fix:eslint & yarn fix:prettier","lint":"yarn lint:eslint & yarn lint:prettier","test":"jest","build":"yarn bundle && yarn build:es5 && yarn build:esm","clean":"rimraf node_modules lib coverage","bundle":"rollup --config rollup.config.js","build:es5":"tsc -p ./tsconfig.es5.json","build:esm":"tsc -p ./tsconfig.esm.json","typecheck":"tsc -p ./tsconfig.json","fix:eslint":"eslint '{src,test}/**/*.ts' --fix","lint:eslint":"eslint '{src,test}/**/*.ts'","fix:prettier":"prettier --write \"{src,test}/**/*.ts\"","lint:prettier":"prettier --check \"{src,test}/**/*.ts\""},"_npmUser":{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},"repository":{"url":"git+https://github.com/amplitude/Amplitude-TypeScript.git","type":"git"},"_npmVersion":"lerna/6.1.0/node@v16.20.1+x64 (linux)","description":"<p align=\"center\">   <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">     <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">   </a>   <b","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"tslib":"^2.4.1","@amplitude/ua-parser-js":"^0.7.33","@amplitude/analytics-types":"^2.1.1","@amplitude/analytics-client-common":"^2.0.4"},"publishConfig":{"tag":"latest","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^2.79.1","rollup-plugin-gzip":"^3.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-execute":"^1.1.1","@rollup/plugin-commonjs":"^23.0.4","@rollup/plugin-typescript":"^10.0.1","@rollup/plugin-node-resolve":"^15.0.1","@amplitude/analytics-browser":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-user-agent-enrichment-browser_0.1.0_1690404681135_0.35847948200094426","host":"s3://npm-registry-packages"}},"1.0.0-beta.1":{"name":"@amplitude/plugin-user-agent-enrichment-browser","version":"1.0.0-beta.1","author":{"name":"Amplitude Inc"},"license":"MIT","_id":"@amplitude/plugin-user-agent-enrichment-browser@1.0.0-beta.1","maintainers":[{"name":"alec.amplitude","email":"alec.boutin@amplitude.com"},{"name":"amplicynthia","email":"cynthia.li@amplitude.com"},{"name":"mae.capozzi","email":"mae.capozzi@amplitude.com"},{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},{"name":"dnshi","email":"dean.xiaoshi@gmail.com"},{"name":"kevinpagtakhan","email":"kevpagtakhan@gmail.com"},{"name":"justin-fiedler","email":"jbfiedler@gmail.com"},{"name":"qingzhuo","email":"qingzhuo.zhen@amplitude.com"},{"name":"rctbusk","email":"rctbusk@gmail.com"},{"name":"jackmccloy","email":"dryice82@gmail.com"},{"name":"amp_haoliu","email":"hao.liu@amplitude.com"},{"name":"myztiq","email":"npm@ryan-kahn.com"},{"name":"curtisbliu","email":"curtis@amplitude.com"},{"name":"jtran","email":"jptran318@gmail.com"},{"name":"kelvin-lu","email":"kelvin@amplitude.com"},{"name":"nutwani","email":"nirmal@amplitude.com"},{"name":"hao.yu","email":"hao.yu@amplitude.com"},{"name":"kelson.warner","email":"kelson.warner@amplitude.com"},{"name":"ajhorst_amp","email":"aj.horst@amplitude.com"},{"name":"brian.giori","email":"brian.giori@amplitude.com"}],"homepage":"https://github.com/amplitude/Amplitude-TypeScript","bugs":{"url":"https://github.com/amplitude/Amplitude-TypeScript/issues"},"dist":{"shasum":"affcfd463647687e0b2c904411672ef878970974","tarball":"https://registry.npmjs.org/@amplitude/plugin-user-agent-enrichment-browser/-/plugin-user-agent-enrichment-browser-1.0.0-beta.1.tgz","fileCount":37,"integrity":"sha512-QWEOq74v9rkXBzo49p9cOhsijASzrCIQR/Nx7Asa5FZxdfbTAKRyQCYg5WraifE+gqzxQK/GAOAauqWYa6KD3g==","signatures":[{"sig":"MEQCICbPbMlyxO9S61nlYRaZcajUeQinR6ktEJxgPlAdoA7JAiAUcmsvha1NZwF2hKQX86EkFDld2iCj7cUVNJidi56tqA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76724},"main":"lib/cjs/index.js","types":"lib/esm/index.d.ts","module":"lib/esm/index.js","readme":"<p align=\"center\">\n  <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">\n    <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">\n  </a>\n  <br />\n</p>\n\n# @amplitude/plugin-user-agent-enrichment-browser\n\nOfficial Browser SDK plugin for user agent enrichment.\n\n## Installation\n\nThis package is published on NPM registry and is available to be installed using npm and yarn.\n\n```sh\n# npm\nnpm install @amplitude/plugin-user-agent-enrichment-browser@^1.0.0\n\n# yarn\nyarn add @amplitude/plugin-user-agent-enrichment-browser@^1.0.0\n```\n\n## Usage\n\nThis plugin works on top of the Amplitude Browser SDK. It's used for enriching events with user agent information using the @amplitude/ua-parser-js. The user agent identifies the application, operating system, vendor, and/or version of the requesting client.\nFor Browser SDK v1.x, we use @amplitude/ua-parser-js internally to parse the user agent information. In Browser v2.x, we have removed this client-side user agent parser and have instead implemented server-side user agent parser. You can use this plugin to maintain consistency with the user agent information from earlier SDK versions.\n\n### 1. Import Amplitude packages\n\n* `@amplitude/analytics-browser`\n* `@amplitude/plugin-user-agent-enrichment-browser`\n\n```typescript\nimport * as amplitude from '@amplitude/analytics-browser';\nimport { userAgentEnrichmentPlugin } from '@amplitude/plugin-user-agent-enrichment-browser';\n```\n\n### 2. Instantiate user agent enrichment plugin\n\nThe plugin accepts 1 optional parameter, which is an `Object` to disable/enable the corresponding tracking options. Each option is enabled by default.\n\n```typescript\nconst uaPlugin = userAgentEnrichmentPlugin({\n  osName: true,\n  osVersion: true,\n  deviceManufacturer: false,\n  deviceModel: false,\n});\n```\n\n#### Options\n\n|Name|Type|Default|Description|\n|-|-|-|-|\n|`osName`|`boolean`|`true`| Enables enrichment of `os_name` property. |\n|`osVersion`|`boolean`|`true`| Enables enrichment of `os_version` property. |\n|`deviceManufacturer`|`boolean`|`true`| Enables enrichment of `device_manufacturer` property. |\n|`deviceModel`|`boolean`|`true`| Enables enrichment of `device_model` property. |\n\n### 3. Install plugin to Amplitude SDK\n\n```typescript\namplitude.add(uaPlugin);\n```\n\n### 4. Initialize Amplitude SDK\n\n```typescript\namplitude.init('API_KEY');\n```\n\n## Resulting page view event\n\nThis plugin parses user agent information using @amplitude/ua-parser-js and enriches events based on your configuration. This affects the value of the following properties: `device_family`, `device_model`, `device_manufacturer`, `device_type`, `os`, `os_name`, and `os_version`.","gitHead":"d7c22fca2eda201f427d6a730abb5e82fb7e66dc","scripts":{"fix":"yarn fix:eslint & yarn fix:prettier","lint":"yarn lint:eslint & yarn lint:prettier","test":"jest","build":"yarn bundle && yarn build:es5 && yarn build:esm","clean":"rimraf node_modules lib coverage","bundle":"rollup --config rollup.config.js","build:es5":"tsc -p ./tsconfig.es5.json","build:esm":"tsc -p ./tsconfig.esm.json","typecheck":"tsc -p ./tsconfig.json","fix:eslint":"eslint '{src,test}/**/*.ts' --fix","lint:eslint":"eslint '{src,test}/**/*.ts'","fix:prettier":"prettier --write \"{src,test}/**/*.ts\"","lint:prettier":"prettier --check \"{src,test}/**/*.ts\""},"_npmUser":{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},"repository":{"url":"git+https://github.com/amplitude/Amplitude-TypeScript.git","type":"git"},"_npmVersion":"lerna/6.1.0/node@v16.20.1+x64 (linux)","description":"<p align=\"center\">   <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">     <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">   </a>   <b","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"tslib":"^2.4.1","@amplitude/ua-parser-js":"^0.7.33","@amplitude/analytics-types":"^2.1.1","@amplitude/analytics-client-common":"^2.0.4"},"publishConfig":{"tag":"v1-beta","access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"rollup":"^2.79.1","rollup-plugin-gzip":"^3.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-execute":"^1.1.1","@rollup/plugin-commonjs":"^23.0.4","@rollup/plugin-typescript":"^10.0.1","@rollup/plugin-node-resolve":"^15.0.1","@amplitude/analytics-browser":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-user-agent-enrichment-browser_1.0.0-beta.1_1690785090291_0.8348256545043986","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@amplitude/plugin-user-agent-enrichment-browser","version":"1.0.0","author":{"name":"Amplitude Inc"},"license":"MIT","_id":"@amplitude/plugin-user-agent-enrichment-browser@1.0.0","maintainers":[{"name":"alec.amplitude","email":"alec.boutin@amplitude.com"},{"name":"amplicynthia","email":"cynthia.li@amplitude.com"},{"name":"mae.capozzi","email":"mae.capozzi@amplitude.com"},{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},{"name":"dnshi","email":"dean.xiaoshi@gmail.com"},{"name":"kevinpagtakhan","email":"kevpagtakhan@gmail.com"},{"name":"justin-fiedler","email":"jbfiedler@gmail.com"},{"name":"qingzhuo","email":"qingzhuo.zhen@amplitude.com"},{"name":"rctbusk","email":"rctbusk@gmail.com"},{"name":"jackmccloy","email":"dryice82@gmail.com"},{"name":"amp_haoliu","email":"hao.liu@amplitude.com"},{"name":"myztiq","email":"npm@ryan-kahn.com"},{"name":"curtisbliu","email":"curtis@amplitude.com"},{"name":"jtran","email":"jptran318@gmail.com"},{"name":"kelvin-lu","email":"kelvin@amplitude.com"},{"name":"nutwani","email":"nirmal@amplitude.com"},{"name":"hao.yu","email":"hao.yu@amplitude.com"},{"name":"kelson.warner","email":"kelson.warner@amplitude.com"},{"name":"ajhorst_amp","email":"aj.horst@amplitude.com"},{"name":"brian.giori","email":"brian.giori@amplitude.com"}],"homepage":"https://github.com/amplitude/Amplitude-TypeScript","bugs":{"url":"https://github.com/amplitude/Amplitude-TypeScript/issues"},"dist":{"shasum":"510e710f077d3aeade677130bc250c6928d0acea","tarball":"https://registry.npmjs.org/@amplitude/plugin-user-agent-enrichment-browser/-/plugin-user-agent-enrichment-browser-1.0.0.tgz","fileCount":37,"integrity":"sha512-lu2PWj/M9TwngCgKZxkcKg0OMaIMqve62YyjBGwk9q9T8fmByT4WzEZDcQMzw7/YeI7yeY2DkOp4Ko6nY1UzIg==","signatures":[{"sig":"MEYCIQDuHyT0w8HxXuUzSN4gMHkpVu3rbTJpbgM+Mn0vCuYptAIhAMEMEnAH6IFSL0ZbP+zi7XDag4Q1Jmn/axRPvYLaRbaQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76717},"main":"lib/cjs/index.js","types":"lib/esm/index.d.ts","module":"lib/esm/index.js","gitHead":"b279f0df007ae0c8e7f8a97e12530af795c473bc","scripts":{"fix":"yarn fix:eslint & yarn fix:prettier","lint":"yarn lint:eslint & yarn lint:prettier","test":"jest","build":"yarn bundle && yarn build:es5 && yarn build:esm","clean":"rimraf node_modules lib coverage","bundle":"rollup --config rollup.config.js","build:es5":"tsc -p ./tsconfig.es5.json","build:esm":"tsc -p ./tsconfig.esm.json","typecheck":"tsc -p ./tsconfig.json","fix:eslint":"eslint '{src,test}/**/*.ts' --fix","lint:eslint":"eslint '{src,test}/**/*.ts'","fix:prettier":"prettier --write \"{src,test}/**/*.ts\"","lint:prettier":"prettier --check \"{src,test}/**/*.ts\""},"_npmUser":{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},"repository":{"url":"git+https://github.com/amplitude/Amplitude-TypeScript.git","type":"git"},"_npmVersion":"lerna/6.1.0/node@v16.20.1+x64 (linux)","description":"<p align=\"center\">   <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">     <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">   </a>   <b","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"tslib":"^2.4.1","@amplitude/ua-parser-js":"^0.7.33","@amplitude/analytics-types":"^2.1.1","@amplitude/analytics-client-common":"^2.0.4"},"publishConfig":{"tag":"latest","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^2.79.1","rollup-plugin-gzip":"^3.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-execute":"^1.1.1","@rollup/plugin-commonjs":"^23.0.4","@rollup/plugin-typescript":"^10.0.1","@rollup/plugin-node-resolve":"^15.0.1","@amplitude/analytics-browser":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-user-agent-enrichment-browser_1.0.0_1690825310751_0.33204789701380344","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@amplitude/plugin-user-agent-enrichment-browser","version":"1.0.1","author":{"name":"Amplitude Inc"},"license":"MIT","_id":"@amplitude/plugin-user-agent-enrichment-browser@1.0.1","maintainers":[{"name":"alec.amplitude","email":"alec.boutin@amplitude.com"},{"name":"amplicynthia","email":"cynthia.li@amplitude.com"},{"name":"mae.capozzi","email":"mae.capozzi@amplitude.com"},{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},{"name":"dnshi","email":"dean.xiaoshi@gmail.com"},{"name":"kevinpagtakhan","email":"kevpagtakhan@gmail.com"},{"name":"justin-fiedler","email":"jbfiedler@gmail.com"},{"name":"qingzhuo","email":"qingzhuo.zhen@amplitude.com"},{"name":"rctbusk","email":"rctbusk@gmail.com"},{"name":"jackmccloy","email":"dryice82@gmail.com"},{"name":"amp_haoliu","email":"hao.liu@amplitude.com"},{"name":"myztiq","email":"npm@ryan-kahn.com"},{"name":"curtisbliu","email":"curtis@amplitude.com"},{"name":"jtran","email":"jptran318@gmail.com"},{"name":"kelvin-lu","email":"kelvin@amplitude.com"},{"name":"nutwani","email":"nirmal@amplitude.com"},{"name":"hao.yu","email":"hao.yu@amplitude.com"},{"name":"kelson.warner","email":"kelson.warner@amplitude.com"},{"name":"ajhorst_amp","email":"aj.horst@amplitude.com"},{"name":"brian.giori","email":"brian.giori@amplitude.com"}],"homepage":"https://github.com/amplitude/Amplitude-TypeScript","bugs":{"url":"https://github.com/amplitude/Amplitude-TypeScript/issues"},"dist":{"shasum":"17e1f5bd7f63b95092ac99cc071cc0f864ef8735","tarball":"https://registry.npmjs.org/@amplitude/plugin-user-agent-enrichment-browser/-/plugin-user-agent-enrichment-browser-1.0.1.tgz","fileCount":37,"integrity":"sha512-kBv4Fgd+EYeW+s8ePPzc7INx4TfC4aDnHjVe1Kd6skcw+eDOSVmJ8Bnfs4qw8gWBEBDNYAlrN0a7r000TsS3Ww==","signatures":[{"sig":"MEYCIQDUB8OhKuM4hfVMo5FiV0EX/OOK9KbSdccad7hOisq9iAIhAKDs1V0gc8oomb2w9yHPAsxXWlv6t6AG5GJ62y2gOsBr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76778},"main":"lib/cjs/index.js","types":"lib/esm/index.d.ts","module":"lib/esm/index.js","gitHead":"2f2b22af6d29531292ef3b331ce816196095bb2b","scripts":{"fix":"yarn fix:eslint & yarn fix:prettier","lint":"yarn lint:eslint & yarn lint:prettier","test":"jest","build":"yarn bundle && yarn build:es5 && yarn build:esm","clean":"rimraf node_modules lib coverage","bundle":"rollup --config rollup.config.js","publish":"node ../../scripts/publish/upload-to-s3.js","build:es5":"tsc -p ./tsconfig.es5.json","build:esm":"tsc -p ./tsconfig.esm.json","typecheck":"tsc -p ./tsconfig.json","fix:eslint":"eslint '{src,test}/**/*.ts' --fix","lint:eslint":"eslint '{src,test}/**/*.ts'","fix:prettier":"prettier --write \"{src,test}/**/*.ts\"","lint:prettier":"prettier --check \"{src,test}/**/*.ts\""},"_npmUser":{"name":"sdk.dev","email":"sdk.dev@amplitude.com"},"repository":{"url":"git+https://github.com/amplitude/Amplitude-TypeScript.git","type":"git"},"_npmVersion":"lerna/6.1.0/node@v16.20.1+x64 (linux)","description":"<p align=\"center\">   <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">     <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">   </a>   <b","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"tslib":"^2.4.1","@amplitude/ua-parser-js":"^0.7.33","@amplitude/analytics-types":"^2.1.1","@amplitude/analytics-client-common":"^2.0.4"},"publishConfig":{"tag":"latest","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^2.79.1","rollup-plugin-gzip":"^3.1.0","rollup-plugin-terser":"^7.0.2","rollup-plugin-execute":"^1.1.1","@rollup/plugin-commonjs":"^23.0.4","@rollup/plugin-typescript":"^10.0.1","@rollup/plugin-node-resolve":"^15.0.1","@amplitude/analytics-browser":"^2.1.2"},"_npmOperationalInternal":{"tmp":"tmp/plugin-user-agent-enrichment-browser_1.0.1_1691615169195_0.27470942618700445","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-07-26T20:51:21.051Z","modified":"2026-06-26T17:03:32.674Z","0.1.0":"2023-07-26T20:51:21.368Z","1.0.0-beta.1":"2023-07-31T06:31:30.463Z","1.0.0":"2023-07-31T17:41:50.960Z","1.0.1":"2023-08-09T21:06:09.381Z"},"bugs":{"url":"https://github.com/amplitude/Amplitude-TypeScript/issues"},"author":{"name":"Amplitude Inc"},"license":"MIT","homepage":"https://github.com/amplitude/Amplitude-TypeScript","repository":{"url":"git+https://github.com/amplitude/Amplitude-TypeScript.git","type":"git"},"description":"<p align=\"center\">   <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">     <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">   </a>   <b","maintainers":[{"email":"curtis@amplitude.com","name":"curtisbliu"},{"email":"kelson.warner@amplitude.com","name":"kelson.warner"},{"email":"sdk.dev@amplitude.com","name":"sdk.dev"},{"email":"eric.kim@amplitude.com","name":"eric_amplitude"},{"email":"daniel.graham@amplitude.com","name":"daniel-graham-amplitude"},{"email":"jesse.wang@amplitude.com","name":"jjwang123"}],"readme":"<p align=\"center\">\n  <a href=\"https://amplitude.com\" target=\"_blank\" align=\"center\">\n    <img src=\"https://static.amplitude.com/lightning/46c85bfd91905de8047f1ee65c7c93d6fa9ee6ea/static/media/amplitude-logo-with-text.4fb9e463.svg\" width=\"280\">\n  </a>\n  <br />\n</p>\n\n# @amplitude/plugin-user-agent-enrichment-browser\n\nOfficial Browser SDK plugin for user agent enrichment.\n\n## Installation\n\nThis package is published on NPM registry and is available to be installed using npm and yarn.\n\n```sh\n# npm\nnpm install @amplitude/plugin-user-agent-enrichment-browser@^1.0.0\n\n# yarn\nyarn add @amplitude/plugin-user-agent-enrichment-browser@^1.0.0\n```\n\n## Usage\n\nThis plugin works on top of the Amplitude Browser SDK. It's used for enriching events with user agent information using the @amplitude/ua-parser-js. The user agent identifies the application, operating system, vendor, and/or version of the requesting client.\nFor Browser SDK v1.x, we use @amplitude/ua-parser-js internally to parse the user agent information. In Browser v2.x, we have removed this client-side user agent parser and have instead implemented server-side user agent parser. You can use this plugin to maintain consistency with the user agent information from earlier SDK versions.\n\n### 1. Import Amplitude packages\n\n* `@amplitude/analytics-browser`\n* `@amplitude/plugin-user-agent-enrichment-browser`\n\n```typescript\nimport * as amplitude from '@amplitude/analytics-browser';\nimport { userAgentEnrichmentPlugin } from '@amplitude/plugin-user-agent-enrichment-browser';\n```\n\n### 2. Instantiate user agent enrichment plugin\n\nThe plugin accepts 1 optional parameter, which is an `Object` to disable/enable the corresponding tracking options. Each option is enabled by default.\n\n```typescript\nconst uaPlugin = userAgentEnrichmentPlugin({\n  osName: true,\n  osVersion: true,\n  deviceManufacturer: false,\n  deviceModel: false,\n});\n```\n\n#### Options\n\n|Name|Type|Default|Description|\n|-|-|-|-|\n|`osName`|`boolean`|`true`| Enables enrichment of `os_name` property. |\n|`osVersion`|`boolean`|`true`| Enables enrichment of `os_version` property. |\n|`deviceManufacturer`|`boolean`|`true`| Enables enrichment of `device_manufacturer` property. |\n|`deviceModel`|`boolean`|`true`| Enables enrichment of `device_model` property. |\n\n### 3. Install plugin to Amplitude SDK\n\n```typescript\namplitude.add(uaPlugin);\n```\n\n### 4. Initialize Amplitude SDK\n\n```typescript\namplitude.init('API_KEY');\n```\n\n## Resulting page view event\n\nThis plugin parses user agent information using @amplitude/ua-parser-js and enriches events based on your configuration. This affects the value of the following properties: `device_family`, `device_model`, `device_manufacturer`, `device_type`, `os`, `os_name`, and `os_version`.","readmeFilename":"README.md"}