Donation Form events not firing

I successfully added an add-in for the donation form. I got my domain added to CSP. However, the events specified in the Donations (form) Extension Points documentation like gift-type-changed are not firing, nor are listed in the args.supportedEvent Types. My supportedEventTypes when the location is ‘form’ is an empty array. Please help!

Full args object from console on form:

  1. context: {location: 'form', donationSessionId: '8b59d6f3-5171-…….483e0', bodyStyle: {…}}
  2. envId: "p-N……WC_nQ"
  3. ready: ƒ (e)
  4. supportedEventTypes: []
  5. themeSettings: {mode: 'light', theme: 'modern'}
  6. [[Prototype]]: Object

Here is my app.js

var client = new BBSkyAddinClient.AddinClient({

callbacks: {

init: (args) => {

console.log("Add-in is initializing...");

console.log("Full args object:", args);

console.log("Context object:", args.context);

console.log("Location:", args.context.location);

// Store supported event types globally

var supportedEventTypes = args.supportedEventTypes || [];

console.log("Supported Event Types:", supportedEventTypes);

// Notify the host that the add-in UI is ready to be shown

args.ready({ showUI: true });

// Check before sending 'authorized' event

if (supportedEventTypes.includes('authorized')) {

client.sendEvent({

type: 'authorized',

context: {}

}).then(() => {

console.log("Add-in authorized successfully.");

}).catch((err) => {

console.error("Error sending authorized event:", err);

});

}

}

}

});

client.addEventHandler({

eventType: 'initial-gift-type',

callback: function (context) {

// get updated data from context object

console.log('Event fired:', context);

}

});

client.addEventHandler({

eventType: 'gift-type-changed',

callback: function (context) {

// get updated data from context object

console.log('Event fired:', context);

}

});

Comments