Session Refresh

Extend session

To ensure continuous and secure interaction with our SDK, it's crucial to maintain an active session. If you receive an event indicating that your session requires a refresh, please follow these steps to update your session promptly. First, extend the session by calling this endpoint. Remember, an active session is key to maintaining the functionality and security of the SDK. Regular session refreshes, especially in response to our notifications, are essential for uninterrupted service.

cardSwitcherConfig.setOnEvent(onEvent: { event, merchant in
    print("cardSwitcher Event: \(event), Merchant: \(merchant)")
    if event == "refresh session request" {
        // extend session
    }
})
session.setConfiguration(config: cardSwitcherConfig)
public void onEvent(String eventName, String merchantName) {
    Log.d("onEvent", eventName + " - " + merchantName);
    if (eventName.equals("refresh session request")){
        // extend session
    }
}
 useEffect(() => {
    const emitterSwitcherEvent = addCardSwitcherListener('onEvent', (event) => {
        if (event === 'refresh session request') {
            // extend session
        }
    });
    return () => {
        emitterSwitcherEvent.remove();
    };
}, []);
  void _onEvent (KnotEvent event) {
    String type = event.type;
    String name = event.event;
    print(type: $type, event: $name");
    if(name == "refresh session request") {
        // extend session
    }
  }
  
onEvent: (event, details) => {
  console.log("onEvent", event, details);
  if (event === "refresh session request") {
    // extend session
  }
}