Skip to content

Migration Guide for v2

Debajit Roy edited this page Oct 10, 2023 · 9 revisions

Migration Steps

  1. Install the latest v2 package.
  2. Change the import statement to import { Transak } from '@transak/transak-sdk' and update it's usage everywhere
  3. Change all instances of transak.on to Transak.on.
  4. Change transak.ALL_EVENTS to '*'
  5. Change all instances of transak.EVENTS to Transak.EVENTS.
  6. If you are currently using the TRANSAK_WIDGET_OPEN event, please update it to use TRANSAK_WIDGET_INITIALISED instead.
  7. You should now be up and running. Happy coding!

Breaking changes

  • Transak has been changed to a named export.
  • The on method is now a static method accessible via Transak.on.
  • transak.ALL_EVENTS has been removed. Please use '*' going forward.
  • TRANSAK_WIDGET_OPEN has been removed. Please use TRANSAK_WIDGET_INITIALISED going forward.
  • The EVENTS property is now a static property accessible via Transak.EVENTS.

Features/Enhancements

  • TypeScript support is now available.
  • Environment values are accessible under Transak.ENVIRONMENTS.

Bugfixes

  • Calling the init method multiple times no longer results in the addition of multiple modal DOM elements.
  • A 100% height no longer hides the Close button.
  • The Close button is now rendered without any delay.
  • Z-index values have been increased to ensure that the Transak modal renders above other modal libraries.
Clone this wiki locally