Skip to content

Conversation

@thabofletcher
Copy link
Contributor

@thabofletcher thabofletcher commented Nov 14, 2025

Ticket ENG-1966

Description Of Changes

Adds the basics for an Adobe Experience Platform integration

Code Changes

  • integration for Adobe Web SDK (untested outside mocks) (window.alloy)
  • integration for ECID OptIn (tested on nvidia.com and jetson-ai-lab.com) (window.adobe.optIn)
  • configuration mapping scheme/defaults for WebSDK and ECID OptIN
  • unit tests
  • shared abstraction with blueconic integration for listening to Fides events

Steps to Confirm

  1. Open nvidia.com and dev tools
  2. Check relevant ECID settings, paste in
(() => { const o = window.adobe?.optIn; return o ? { aa: o.isApproved(o.Categories.ANALYTICS), target: o.isApproved(o.Categories.TARGET), aam: o.isApproved(o.Categories.AAM) } : 'Not loaded'; })()
  1. Inject fides.js from the Vercel env
  2. Run the aep integration:
window.fidesAEP = Fides.aep({
    purposeMapping: {
      performance: ['collect', 'measure'],
      functional: ['personalize'],
      advertising: ['personalize', 'share']
    },
    ecidMapping: {
      performance: ['aa'],
      functional: ['target'],
      advertising: ['aam']
    }
  });
  1. Re check ECID settings at the start and after using Fides.showModal() to make changes

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ready Ready Preview Comment Nov 14, 2025 10:55pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
fides-privacy-center Ignored Ignored Nov 14, 2025 10:55pm

@thabofletcher thabofletcher changed the title Eng 1966 aep integration ENG-1966 Adobe Experience Platform integration Nov 14, 2025
- Add aep.ts integration for Adobe Web SDK and ECID Opt-In Service
- Add integration-utils.ts with shared subscribeToConsent helper
- Add onetrust.ts integration for OneTrust migration support
- Update blueconic.ts to use shared integration-utils
- Update consent-types.ts and init-utils.ts with AEP and OneTrust types
- Add ADOBE_ORG_ID configuration support in Privacy Center
- Inject adobe_mc_orgid into window for Adobe Visitor API
- Remove suggestPurposeMapping function (not used)
- Remove getFidesDiagnostics function (not Adobe-specific)
- Remove fides field from AEPDiagnostics interface
- Keep Adobe-specific diagnostic functions for debugging
- Remove onetrust.ts file entirely
- Remove OneTrust imports from aep.ts, consent-types.ts, init-utils.ts
- Remove OneTrust initialization code from aep() function
- Remove oneTrust field from AEPDiagnostics interface
- Remove onetrust property from FidesGlobal interface
- AEP integration now completely independent
- Remove AEPDiagnostics interface
- Remove all diagnostic export functions (getAdobeCookies, getAlloyDiagnostics, getVisitorDiagnostics, getOptInDiagnostics, getLaunchDiagnostics, getAnalyticsDiagnostics)
- Remove getECIDFromCookies helper
- Keep core integration functionality (aep(), pushConsentToAdobe(), getAdobeConsentState())
- Remove summary field that mapped Adobe consent to generic terms
- Keep only actual Adobe consent state: alloy purposes and ecidOptIn (aa, target, aam)
- Simplifies API and shows what Adobe actually has
- Support all Adobe categories dynamically (aa, target, aam, adcloud, campaign, ecid, livefyre, mediaaa)
- Replace hardcoded if/else blocks with dynamic iteration through Categories object
- Update ecidMapping type to accept any string[] instead of restricted union
- Use Record<string, boolean> for approvals instead of hardcoded object
- Dynamically apply approve/deny by iterating through all available categories
- Update AEPConsentState to return dynamic categories object
- getAdobeConsentState() now iterates through all Adobe categories programmatically
- Add DEFAULT_ECID_MAPPING constant matching DEFAULT_PURPOSE_MAPPING
- Remove complex purposeToEcidMapping conversion logic
- Simplify ECID handling to use ecidMapping || DEFAULT_ECID_MAPPING
- Update documentation to show default behavior instead of 'backward compatible'
- Clean up 30+ lines of unnecessary if/else logic
This configuration belongs in ENG-1966-aep-configuration branch
This belongs in the configuration branch
FIDES_COOKIE_SUFFIX is unrelated to Adobe and should not have been removed
- Test Adobe Web SDK (Alloy) consent syncing
- Test ECID Opt-In Service for legacy AppMeasurement
- Test default and custom purpose/ECID mappings
- Test OR logic for overlapping category mappings
- Test dynamic handling of all Adobe categories
- Test event subscription (FidesReady, FidesUpdated)
- Test synthetic events for late-loading integrations
- Test debug logging and error handling
- Test consent() API state reporting
- Test edge cases (empty consent, undefined values, etc.)

26 tests with comprehensive coverage of Adobe integration
- Prefix unused parameters with underscore
- Add eslint-disable comments for intentional console statements
- Move buildAdobePurposes function before usage to avoid no-use-before-define
- Remove duplicate buildAdobePurposes function
- Remove unused variable declarations in tests
Fides may have other consent keys that aren't in the Adobe mapping.
That's fine - they just don't get sent to Adobe. No need to warn about it.

- Simplified buildAdobePurposes to only map configured keys
- Removed tracking of matched/unmatched keys
- Removed warning about unmatched keys
- Removed corresponding test
- Simplified debug logging
- Remove unused parameters from mock functions
- Use array destructuring with empty first element for unused categoryName
- Use mockReturnValue instead of defining implementation for mockIsApproved
The initialized flag is only needed for integrations that need
more than just consent (like GTM needing fides_meta, identity, etc).

Simple integrations like blueconic and aep only need consent,
so subscribeToConsent should fire if window.Fides.consent exists,
regardless of the initialized flag.

This matches the original blueconic behavior which called
configureObjectives() immediately without checking initialized.
@thabofletcher thabofletcher force-pushed the ENG-1966-aep-integration branch from 3395f89 to 12eba5b Compare November 14, 2025 17:57
thabofletcher and others added 7 commits November 14, 2025 11:24
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
thabofletcher and others added 8 commits November 14, 2025 11:25
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
- Define minimal TypeScript interfaces for Adobe SDKs (Alloy, OptIn)
- Use unknown for SDKs we don't directly interact with (safer than any)
- Add isApproved method to AdobeOptIn interface
- Use non-null assertion (!) where we've already checked for existence
- Remove debug logging tests (not critical functionality to test)
- Mock fidesDebugger in AEP tests
- Remove debug option from AEPOptions interface (fidesDebugger handles it)
- Remove all if (debug) wrappers around fidesDebugger calls
- Use const assignment with null checks instead of ! operator (cleaner)
- Replace hasAlloy/hasOptIn booleans with const alloy/optIn assignments
- TypeScript narrows types properly with const assignments
- Remove test for debug warning (no longer has debug option)
Removed mockConsoleLog and mockConsoleWarn since we no longer test
debug output after removing the debug flag
Following the GTM integration pattern, change subscribeToConsent to use
Record<FidesEventType, boolean> instead of FidesEventType[]. This forces
developers to explicitly consider whether new FidesEventTypes should be
forwarded to integrations.

Benefits:
- When a new FidesEventType is added, TypeScript will error on any
  Record<FidesEventType, boolean> that doesn't include it
- Forces explicit decision-making for each event type
- Self-documenting which events each integration cares about

Default config enables only FidesReady and FidesUpdated, which is
appropriate for simple integrations like AEP and BlueConic.
Removed unused properties from type definitions:
- AdobeNamespace.target and .analytics (not accessed)
- Window.Visitor, .s, ._satellite (not accessed)

Keep only what we actually use: window.alloy and window.adobe.optIn
- Changed error catches to use fidesDebugger instead of console.error
- Removed eslint-disable-next-line no-console comments
- Removed tests that validated debug logging behavior
- Simplified test that checks Adobe not loaded scenario
@gilluminate gilluminate self-requested a review November 14, 2025 22:26
@thabofletcher thabofletcher marked this pull request as ready for review November 14, 2025 22:50
@thabofletcher thabofletcher requested a review from a team as a code owner November 14, 2025 22:50
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Nov 14, 2025

Greptile Overview

Greptile Summary

This PR adds Adobe Experience Platform (AEP) integration to FidesJS, enabling consent synchronization with both modern Adobe Web SDK (Alloy) and legacy ECID Opt-In Service.

Key Changes:

  • New aep.ts integration supporting dual Adobe consent systems with configurable purpose/category mappings
  • Shared integration-utils.ts with subscribeToConsent() helper for consistent event handling across integrations
  • Refactored BlueConic integration to use new shared utilities, removing duplicate code
  • Comprehensive test suite with 546 lines covering both Adobe products, custom mappings, edge cases, and event subscriptions
  • Bundle size increased from 26KB to 27KB (within acceptable limits)

Implementation Quality:
The implementation demonstrates strong architectural patterns with proper TypeScript interfaces, thorough error handling, debug logging via fidesDebugger, and dynamic category support for future-proofing. The shared utility abstraction reduces code duplication and ensures consistent behavior across integrations.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Score reflects well-structured code with proper TypeScript typing, comprehensive test coverage (546 test lines), consistent patterns with existing integrations, proper error handling, and thorough documentation. The refactoring to shared utilities improves maintainability. No security concerns, logic errors, or breaking changes identified.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
clients/fides-js/src/integrations/aep.ts 5/5 New Adobe Experience Platform integration supporting both Web SDK (Alloy) and legacy ECID Opt-In service with proper error handling and debug logging
clients/fides-js/src/integrations/integration-utils.ts 5/5 New shared utility for integrations to subscribe to Fides consent events with configurable event filtering and synthetic event support
clients/fides-js/tests/integrations/aep.test.ts 5/5 Comprehensive test coverage for AEP integration including both Adobe products, custom mappings, edge cases, and event subscriptions

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

8 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

LGTM!✨

@thabofletcher thabofletcher added this pull request to the merge queue Nov 15, 2025
Merged via the queue into main with commit 86cd63f Nov 15, 2025
42 of 43 checks passed
@thabofletcher thabofletcher deleted the ENG-1966-aep-integration branch November 15, 2025 00:19
jjdaurora pushed a commit that referenced this pull request Dec 5, 2025
Co-authored-by: Jason Gill <jason.gill@ethyca.com>
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.

4 participants