To simplify your application logic and integration with the Knot JS SDK, Version 1.0 includes a number of breaking changes that may affect the way your integration works or behaves.The new version includes a number of significant improvements:
Enhanced speed and stability in loading merchant flows.
More streamlined initialization of the SDK.
Simplified event handling, more informative event messaging, and uniform naming conventions for easier debugging.
Improved maintainability and foundations for new feature compatibility.
Configuring and opening the Knot SDK has changed significantly in JS Version 1.0 and requires some refactoring in order to initialize the SDK with a session. Errors are now encapsulated in a KnotError object which provides an enumerated value to debug with.
Knot.openCardOnFileSwitcher is replaced with a more flexible open.
Before
JavaScript
Copy
Ask AI
import KnotapiJS from "knotapi-js";const knotapi = new KnotapiJS();// Invoke the openCardOnFileSwitcher method with required parametersknotapi.openCardOnFileSwitcher({ sessionId: "Your Session ID", clientId: "Your Client ID", environment: "development" // or "production"});
After
Copy
Ask AI
import KnotapiJS from "knotapi-js";const knotapi = new KnotapiJS();// Invoke the open method with required parametersknotapi.open({sessionId: "Your Session ID",clientId: "Your Client ID",environment: "development", // or "production"product: "card_switcher"});