# Amazon A9

Set up Amazon A9 Header Bidding

## How To

Amazon A9 configuration can be simple or detailed:

### Simple

Amazon A9 can be turned on/off by simply setting a `Boolean` (see example):

    var player = TOP.createAndInitPlayer({
        config : {
            features : {
                amazonA9 : true // Enables Amazon A9 header bidding using default config values
            }
        }
    });

### Detailed

To specify more configuration information, set a AmazonA9FeatureData object:

    var player = TOP.createAndInitPlayer({
        config : {
            features : {
                amazona9 : {
                    enabled : true,

                    // To be used as the slot name in the case of subsequent playback session starts. (Excluding the first playback session start)
                    initialSlotName: 'aps-preroll',

                    // The name of the slot for subsequent targeting data requests within the same playback session.
                    midrollSlotName: 'aps-midroll',

                    // An override method for the first targeting data retrieval. Returns a promise.
                    getTargetingData : function(timeout) {
                        // Custom logic here.
                        return A9Lib.getTargetingData(timeout);
                    },

                    // An override method for the subsequent targeting data retrieval. Ensures fresh results. Returns a promise.
                    getRefreshedTargetingData : function(slotName, timeout) {
                        // Custom logic here.
                        return A9Lib.getRefreshedTargetingData(slotName, timeout);
                    }
                }
            }
        }
    });