The fatzebra.js Javascript SDK will emit various events that your client-side Javascript code can subscribe to.

An event may be emitted along with a data payload, which is encapsulated into a CustomEvent object and can be retrieved via the detail property of the event.

List of fatzebra.js events

Successful Event Data Format

AttributeTypeDescription
messagestringmessage
dataobjectdata
{
  message: "xxx",
  data: {
   ... 
  }
}

Error Event Data Format

AttributeTypeDescription
errorsarray of stringerror messages
dataobjectThis could be null if no data is available.
{
  errors: [
    "xxx",
    ...
  ],
  data: {
   //  
  }
}