
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@amplitude/plugin-user-agent-enrichment-browser
Advanced tools
Official Browser SDK plugin for user agent enrichment.
This package is published on NPM registry and is available to be installed using npm and yarn.
# npm
npm install @amplitude/plugin-user-agent-enrichment-browser@^1.0.0
# yarn
yarn add @amplitude/plugin-user-agent-enrichment-browser@^1.0.0
This 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. For 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.
@amplitude/analytics-browser
@amplitude/plugin-user-agent-enrichment-browser
import * as amplitude from '@amplitude/analytics-browser';
import { userAgentEnrichmentPlugin } from '@amplitude/plugin-user-agent-enrichment-browser';
The plugin accepts 1 optional parameter, which is an Object
to disable/enable the corresponding tracking options. Each option is enabled by default.
const uaPlugin = userAgentEnrichmentPlugin({
osName: true,
osVersion: true,
deviceManufacturer: false,
deviceModel: false,
});
Name | Type | Default | Description |
---|---|---|---|
osName | boolean | true | Enables enrichment of os_name property. |
osVersion | boolean | true | Enables enrichment of os_version property. |
deviceManufacturer | boolean | true | Enables enrichment of device_manufacturer property. |
deviceModel | boolean | true | Enables enrichment of device_model property. |
amplitude.add(uaPlugin);
amplitude.init('API_KEY');
This 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
.
FAQs
<b
The npm package @amplitude/plugin-user-agent-enrichment-browser receives a total of 2,545 weekly downloads. As such, @amplitude/plugin-user-agent-enrichment-browser popularity was classified as popular.
We found that @amplitude/plugin-user-agent-enrichment-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.