npm.io
0.1.20 • Published 1 week ago

@amplitude/plugin-custom-enrichment-browser

Licence
MIT
Version
0.1.20
Deps
2
Size
63 kB
Vulns
0
Weekly
0
Stars
179


@amplitude/plugin-custom-enrichment-browser

Official Browser SDK plugin for custom enrichment

Installation

This package is published on NPM registry and is available to be installed using npm and yarn.

# npm
npm install @amplitude/plugin-custom-enrichment-browser

# yarn
yarn add @amplitude/plugin-custom-enrichment-browser

Usage

This plugin works on top of Amplitude Browser SDK and allows the user to execute custom functionality on their events. To use this plugin, you need to install @amplitude/analytics-browser version v2.0.0 or later.

1. Import Amplitude packages
  • @amplitude/plugin-custom-enrichment-browser
import { customEnrichmentPlugin } from '@amplitude/plugin-custom-enrichment-browser';
2. Instantiate custom enrichment plugin
const customEnrichmentPlugin = customEnrichmentPlugin();
Options
3. Install plugin to Amplitude SDK
amplitude.add(customEnrichmentPlugin);
4. Initialize Amplitude SDK
amplitude.init('API_KEY');

Result

This plugin executes a user-defined script, defined within Amplitude Remote Configuration Settings.

Event type
  • No event type added
Event properties
  • Defined by user