We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

Do JavaScript Callbacks Work for Lightweight Templates?

Yes. JavaScript callbacks like showOffer and showTemplate work for Lightweight Templates the same way they do for Classic templates. You can register handlers using tp.push(["addHandler", ...]) as you normally would:

tp.push(["addHandler", "showTemplate", () => {
  console.log('showTemplate');
}]);

tp.push(["addHandler", "showOffer", () => {
  console.log('showOffer');
}]);

No changes are required when migrating from Classic to Lightweight — existing handler registrations continue to function without modification.

Last updated: