Skip to content

Conversation

zhukaihan
Copy link
Collaborator

Summary

Add setTrackAssignmentEvent.

Checklist

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

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a setTrackAssignmentEvent method to the Amplitude Experiment JavaScript Client SDK that allows users to control whether assignment events are tracked when fetching experiment variants.

  • Introduces a new setTrackAssignmentEvent method that persists tracking preferences to storage
  • Modifies the fetch logic to include tracking options from stored preferences
  • Adds comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

File Description
packages/experiment-browser/src/experimentClient.ts Implements the setTrackAssignmentEvent method and integrates tracking options into the fetch flow
packages/experiment-browser/src/storage/cache.ts Adds SingleValueStoreCache class and getVariantsOptionsStorage utility for persisting fetch options
packages/experiment-browser/src/storage/cookie-storage.ts Adds a new CookieStorage implementation for the Storage interface
packages/experiment-browser/test/client.test.ts Comprehensive test suite covering all aspects of the new setTrackAssignmentEvent functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

promptless bot commented Oct 6, 2025

📝 Documentation updates detected!

New suggestion: Document setTrackAssignmentEvent method for JavaScript SDK

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.

1 participant