Callback
BidJS Events
Some websites require functionality beyond that which BidJS requires.
In order to help support this, we expose many of the events which happen within BidJS, so that third party developers can react to them.
Listening to Events
We provide a callback
option within the BidJS configuration. This can be overwritten with your own functionality
window.bidjs = {
config: {
...
},
modules: {
...
},
options: {
...
},
callback: function(event) {
// you can have any of your own logic here
}
}
Event format
We have a standardised format for all events, so you can write your own functionality to handle multiple types of event.
Your callback method will always be called with an event in the following format
{
"action": "BIDJS_EVENT_NAME",
"data": {
// any related information (if any) will be inserted here
}
}
Events
There are numerous events that are broadcast.
General Functionality
BIDJS_INITIALISED
/BIDJS_MODULES_INITIALISED
- BidJS Scripts first begin runningBIDJS_LOADED
/BIDJS_MODULES_LOADED
- BidJS has finished loadingBIDJS_NAVIGATED
/BIDJS_MODULES_NAVIGATED
- The user has changed page on BidJSBIDJS_AUTHENTICATED
/BIDJS_UNAUTHENTICATED
- The user login state has changed
Auction Functionality
AUCTION_SUBSCRIBED
- The user is receiving live updates for an auctionBID_PLACED
/BID_CANCELLED
/BID_REINSTATED
- Informs of a change in the bid, or a new bid for a listingREGISTRANT_UPDATED
- Registration state has changed for a userSALE_ADDED
/SALE_WITHDRAWN
- A listing has been added or removed on the AuctionSALE_COMPLETED
/SALE_STARTED
- An item has been completed (sold, passed etc), or been started (re-listed, re-offered etc)SALE_INCREMENT_SET
/SALE_NEXT_BID_SET
- The increment or next bid value of a listing has changedSALE_UNIT_BIDDING_TYPE_SET
- Advises of a change in how the units for a listing are being pricedWEBCAST_FEED_SET
- The webcast video / audio feed has changed propertiesWEBCAST_INPLAY_SET
- The webcast inplay lot has changedWEBCAST_INPLAY_STATE_SET
- The webcast has been paused / resumedWEBCAST_INPLAY_WARNING
- The sale warning for inplay item has updatedWEBCAST_MESSAGE_SET
- A webcast message has changed