KnotEvent
) events, and handle errors. Errors are now encapsulated in a KnotError
object which provides an enumerated value to debug with.
openCardOnFileSwitcher
, addCardSwitcherListener
, and eventNames
from “react-native-knotapi” are replaced with Knot
and addKnotListener
.Product
enum values .card_switcher
, .transaction_link
, and .link
.useCategories
, useSearch
, and merchantIds
.open
action now requires configuration values that are required to initialize with a session.addKnotListener
instead of closures.onSuccess
, onError
, and onExit
are now product agnostic.onEvent
method introduces the KnotEvent
object to better handle Knot emitted events.KnotError
type provides improved error descriptions.sendCard
parameter is deprecated and its functionality incorporated into the metaData
dictionary within KnotEvent
when KnotEvent.event
equals AUTHENTICATED
.sendCard
property, as it is rarely applicable to the integration with the Knot SDK.sendCard
parameter has been deprecated and its functionality has been incorporated into the metaData
dictionary within KnotEvent
when the KnotEvent.event
equals AUTHENTICATED
. This change enhances flexibility by allowing additional contextual data to be included in events without requiring separate parameters. Previously, sendCard
was accessed as a standalone value, but now developers can retrieve it from the metaData
dictionary in the event callback. This approach ensures better extensibility and consistency across different event types. To access the sendCard
value, simply extract it from the event’s metaData
dictionary.
Event Name Prior to 1.0 | 1.0 Event Name |
---|---|
refresh session request | REFRESH_SESSION_REQUEST |
merchant clicked | MERCHANT_CLICKED |
login started | LOGIN_STARTED |
authenticated | AUTHENTICATED |
otp required | OTP_REQUIRED |
security questions required | SECURITY_QUESTIONS_REQUIRED |
approval required | APPROVAL_REQUIRED |
KnotError
enum.errorDescription
) and a unique error code (errorCode
).Error Case | Description |
---|---|
.invalidSession | The session is invalid. |
.expiredSession | The session has expired. |
.invalidClientId | The client ID is invalid. |
.internalError | An internal error occurred. |
Knot.close()
as opposed to being bound to the session object.