As a user goes through the Benji Connect flow, your application will receive the following events to the callback functions you specified as part of the initialization flow :
Event that indicates that the user has exited the Benji Connect flow
This event does not return any return values. The onExit event can be triggered as a result of the following user actions :
The user has completed a full flow and has pressed close button at the end of the flow
The user has exited the flow before completing a full flow by pressing on the close button or pressing outside of the connect modal
Note that the onExit will be called regardless of if the user has succesfully linked their loyalty account. The only event that indicates a succesfull connection is the onSuccess even above.
Event that indicates an event as part of the user flow on the Benji Connect flow
This event returns 2 values :
event : The name of the event. The following event names are supported :
user_partner_select : The user has selected a loyalty partner to connect with
user_authenticated_with_partner : The user has completed authentication with the partner network
go_back_clicked: The user clicked on the back button as part of the connect flow
user_inactive: The user has not clicked on the flow for more than 1 minute.
metadata : Metadata with additional data on the event if relevant. Note that not all values will be present at all times, and are specific to certain events.
Copy
{"partner_id":"<the Benji partner ID","external_user_id":"<the ID of the user in your system, as passed in to the SDK during initialization","screen_name":"the screen name as part of the Benji flow"}
Event that indicates an error has occured as part of the Benji Connect flow
This event returns 2 values :
error : The name of the error. The following error code names are supported :
unexpected_error : An unexpected error has occured on the Benji Platform.
partner_connect_error : An error occured while trying to connect the user with their selected loyalty network
error_id : An ID to identify the error on the Benji platform. WHen contacting Benji support, you can use this error ID to help our team quickly identify and help investigate the error if applicable