Skip to content
Open
10 changes: 8 additions & 2 deletions src/consent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import KitFilterHelper from './kitFilterHelper';
import Constants from './constants';
import { IMParticleUser } from './identity-user-interfaces';
import { IMParticleWebSDKInstance } from './mp-instance';
import { logDeprecatedMethodUsage } from './reporting/deprecatedMethodLogger';

const { CCPAPurpose } = Constants;

Expand Down Expand Up @@ -505,8 +506,13 @@ export default function Consent(this: IConsent, mpInstance: IMParticleWebSDKInst

// TODO: Can we remove this? It is deprecated.
function removeCCPAState(this: ConsentState) {
mpInstance.Logger.warning(
'removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead'
logDeprecatedMethodUsage(
{
methodName: 'Consent.removeCCPAState',
warningMessage: 'removeCCPAState is deprecated and will be removed in a future release; use removeCCPAConsentState instead',
},
mpInstance.Logger,
mpInstance._LoggingDispatcher
);
// @ts-ignore
return removeCCPAConsentState();
Expand Down
17 changes: 12 additions & 5 deletions src/events.interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
Callback,
SDKEventAttrs,
SDKEventOptions,
TransactionAttributes,
Expand All @@ -8,13 +7,20 @@ import {
BaseEvent,
SDKEvent,
SDKEventCustomFlags,
SDKImpression,
SDKProduct,
SDKProductImpression,
SDKPromotion,
} from './sdkRuntimeModels';
import { valueof } from './utils';
import { EventType, ProductActionType, PromotionActionType } from './types';

export type TrackingCallback = ((
position?: GeolocationPosition | {
coords: { latitude: number | string; longitude: number | string };
}
) => void) | null;

// Supports wrapping event handlers functions that will ideally return a specific type
type EventHandlerFunction<T> = (element: HTMLLinkElement | HTMLFormElement) => T;

Expand Down Expand Up @@ -45,11 +51,12 @@ export interface IEvents {
): void;
logEvent(event: BaseEvent, eventOptions?: SDKEventOptions): void;
logImpressionEvent(
impression: SDKProductImpression,
// https://go/j/SDKE-1199
impression: SDKImpression | SDKImpression[] | SDKProductImpression | SDKProductImpression[],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I brought this up with @rmi22186 earlier. I would like for us to not support both arrays and non-arrays for these endpoints, but that might have to be a follow up project.

@jaissica12 jaissica12 May 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created a follow-up ticket to track this: https://go/j/SDKE-1199

attrs?: SDKEventAttrs,
customFlags?: SDKEventCustomFlags,
eventOptions?: SDKEventOptions
);
): void;
logOptOut(): void;
logProductActionEvent(
productActionType: valueof<typeof ProductActionType>,
Expand All @@ -61,7 +68,7 @@ export interface IEvents {
): void;
logPromotionEvent(
promotionType: valueof<typeof PromotionActionType>,
promotion: SDKPromotion,
promotion: SDKPromotion | SDKPromotion[],
attrs?: SDKEventAttrs,
customFlags?: SDKEventCustomFlags,
eventOptions?: SDKEventOptions
Expand All @@ -78,6 +85,6 @@ export interface IEvents {
attrs?: SDKEventAttrs,
customFlags?: SDKEventCustomFlags
): void;
startTracking(callback: Callback): void;
startTracking(callback: TrackingCallback): void;
stopTracking(): void;
}
Loading
Loading