Skip to main content

Events and Extensions

Events and extensions add behavior without rewriting base templates and scenarios. Use them for analytics, additional blocks, notifications, and external integrations.

Common Extension Points​

PointExample
PageAdd a block to the home page or player cabinet
FormAdd an extra field or hint
API resultShow a notification after a successful operation
ModuleExtend shop, warehouse, support, or marketplace
AnalyticsSend a safe event after a user action

Principles​

  • Avoid changing base templates unless necessary.
  • Put the extension into a separate partial or component.
  • Do not block the main scenario if an external integration is unavailable.
  • Do not store secrets in JavaScript or templates.
  • Log only technical identifiers and safe context.

User Events​

For interface events, pass only safe data:

window.dispatchEvent(new CustomEvent('mmoweb:payment:created', {
detail: {
paymentId: 'public-id',
amount: 100,
currency: 'USD'
}
}));

Do not pass private keys, tokens, PIN codes, payment details, or internal payment provider responses to the browser.

Extending Modules​

If an extension belongs to a module, keep these files together:

  • block template;
  • block styles;
  • translation keys;
  • setup notes;
  • verification scenario.

This makes module updates easier and clarifies which files participate in the change.

Errors​

An extension should not hide system API errors. Show a clear message to the user, and log the technical error category and request id.