Skip to content

feat(plugin-custom-enrichment): add plugin based on remote config settings#1586

Merged
cyhk merged 5 commits intomainfrom
AMP-139971-follow-up
Mar 20, 2026
Merged

feat(plugin-custom-enrichment): add plugin based on remote config settings#1586
cyhk merged 5 commits intomainfrom
AMP-139971-follow-up

Conversation

@cyhk
Copy link
Copy Markdown
Contributor

@cyhk cyhk commented Mar 11, 2026

Summary

This installs the plugin based on remote config's customEnrichment settings. The plugin will install only when explicitly 'enabled' in CustomEnrichmentOptions.

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Note

Medium Risk
Medium risk because it changes SDK initialization and remote-config merging to conditionally install an enrichment plugin, which can affect event payloads and plugin load behavior if misconfigured.

Overview
Adds support for a new customEnrichment config (and remote-config field) that conditionally installs @amplitude/plugin-custom-enrichment-browser during AmplitudeBrowser.init().

Extends browser config/types to carry customEnrichment, adds isCustomEnrichmentEnabled gating logic (treating {enabled:false} as off), and updates remote-config joining to apply customEnrichment when present (ignoring null). Tests are added for plugin installation and remote-config merge behavior, and the custom-enrichment plugin build now outputs an additional IIFE bundle for snippet-style usage.

Written by Cursor Bugbot for commit 24e3dc3. This will update automatically on new commits. Configure here.

Comment thread packages/analytics-browser/src/browser-client.ts
Comment thread packages/analytics-core/src/types/config/browser-config.ts Outdated
Copy link
Copy Markdown
Collaborator

@daniel-graham-amplitude daniel-graham-amplitude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

Comment thread packages/analytics-browser/src/config/joined-config.ts
Copy link
Copy Markdown
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cyhk LGTM!

Test:

Image

Base automatically changed from AMP-139971 to main March 19, 2026 21:25
@cyhk cyhk force-pushed the AMP-139971-follow-up branch from b726191 to 6067ef8 Compare March 19, 2026 22:10
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread packages/analytics-browser/src/config.ts
@cyhk cyhk merged commit 617ebfe into main Mar 20, 2026
10 checks passed
@cyhk cyhk deleted the AMP-139971-follow-up branch March 20, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants