Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Subscriptions
English French
English French

Do JavaScript Callbacks Work for Lightweight Templates?

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: