Skip to content

Commit e89f2d7

Browse files
rmi22186claude
andauthored
🤖 Merge PR DefinitelyTyped#74955 [mparticle__web-sdk] Add SHA256 identity aliases and Rokt.onShoppableAdsReady by @rmi22186
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4640060 commit e89f2d7

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎types/mparticle__web-sdk/index.d.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ interface SetExtensionData {
435435
(extensionData: RoktPartnerExtensionData<unknown>): void;
436436
}
437437

438+
interface OnShoppableAdsReady {
439+
(callback: () => void): void;
440+
}
441+
438442
export const endSession: EndSession;
439443
export const getAppName: GetAppName;
440444
export const getAppVersion: GetAppVersion;
@@ -627,6 +631,7 @@ export namespace Rokt {
627631
const hashSha256: HashSha256;
628632
const setExtensionData: SetExtensionData;
629633
const use: Use;
634+
const onShoppableAdsReady: OnShoppableAdsReady;
630635
}
631636

632637
export interface IdentifyRequest {
@@ -681,6 +686,8 @@ export interface UserIdentities {
681686
twitter?: string | null;
682687
microsoft?: string | null;
683688
yahoo?: string | null;
689+
email_sha256?: string | null;
690+
mobile_sha256?: string | null;
684691
}
685692

686693
interface Cart {
@@ -903,6 +910,7 @@ declare class mParticleInstance {
903910
hashSha256: HashSha256;
904911
setExtensionData: SetExtensionData;
905912
use: Use;
913+
onShoppableAdsReady: OnShoppableAdsReady;
906914
};
907915
MPSideloadedKit: typeof MPSideloadedKit;
908916
PromotionType: {

‎types/mparticle__web-sdk/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/mparticle__web-sdk",
4-
"version": "2.58.9999",
4+
"version": "2.66.9999",
55
"projects": [
66
"https://github.com/mParticle/mparticle-web-sdk"
77
],

‎types/mparticle__web-sdk/test/mparticle__web-sdk-instance-tests.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@ const identifyIdentities: mParticle.IdentifyRequest = {
496496
twitter: "email",
497497
microsoft: "email",
498498
yahoo: "email",
499+
email_sha256: "email",
500+
mobile_sha256: "email",
499501
},
500502
};
501503

@@ -824,6 +826,10 @@ mParticle.Rokt.setExtensionData({
824826
"personalization": { variant: "A" },
825827
});
826828

829+
mParticle.Rokt.onShoppableAdsReady(() => {
830+
console.log("Shoppable ads ready");
831+
});
832+
827833
// Test with identifier
828834
mParticle.Rokt.selectPlacements({
829835
attributes: {

‎types/mparticle__web-sdk/test/mparticle__web-sdk-tests.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ mParticle.Rokt.hashSha256(true);
265265
mParticle.Rokt.hashSha256(undefined);
266266
mParticle.Rokt.hashSha256(null);
267267

268+
mParticle.Rokt.onShoppableAdsReady(() => {
269+
// shoppable ads ready
270+
});
271+
268272
mParticle.generateHash("test-string");
269273

270274
mParticle.ready(() => {
@@ -558,6 +562,8 @@ const identifyIdentities: mParticle.IdentifyRequest = {
558562
twitter: "email",
559563
microsoft: "email",
560564
yahoo: "email",
565+
email_sha256: "email",
566+
mobile_sha256: "email",
561567
},
562568
};
563569

0 commit comments

Comments
 (0)