# Config

## spiffy.config(*configObj*)

Modify the global Spiffy.js config before `spiffy.load()`&#x20;

* `configObj` - object of config properties

  * `hideSummary:`**`false`** - Hide/show the order summary on checkouts

  * `hideCoupon:`**`false`** - Hide/show coupon field on checkouts

  * `hideSidebar:`` `**`true`** - Hide/show sidebar content on checkouts

  * `hideHeader:`**`true`** - Hide/show page header on checkouts

  * `hideFooter:`**`true`** - Hide/show page footer on checkouts<br>

  * `hidePortalCustomer:`` `**`false`** - Hide/show logged in customer details in portal

  * `hidePortalHeader:`` `**`false`** - Hide/show logo and title header in portal

  * `hidePortalSubscriptions:`` `**`false`** - Hide/show subscription management in portal

  * `hidePortalPaymentPlans:`` `**`false`** - Hide/show payment plan management in portal

  * `hidePortalToggle:`` `**`false`** - Hide/show the button to toggle between customer/affiliate portal

  * `hidePortalOrders:`` `**`false`** - Hide/show list of orders in portal

  * `hidePortalPasswordChange:`` `**`false`** - Hide/show password change option in portal

  * `hidePortalLogout:`` `**`false`** - Hide/show logout button in portal<br>

  * `pageTakeover:`**`true`** - Enable/disable full-page for checkouts upsells/thank you pages

  * `upsellPageTakeover:`**`true`** - Enable/disable full-page for checkouts upsell pages

  * `thanksPageTakeover:`**`true`** - Enable/disable full-page for checkouts thank you page<br>

  * `popupEnabled:`**`false`** - Enable/disable opening Spiffy checkout links in popup modal

  * `popupPrefetch:`**`true`** - Enable/disable prefetching popup when link is moused over

  * `compatibilityMode:`**`true`** - Enable/disable the use of `<div>`'s for components

  * `trackingEnabled:`**`true`** - Enable/disable the tracking/analytics features

  * `autoIdentify:`` `**`true`** - Uses form submissions to improve customer recognition and affiliate tracking

  * `preserveUrlParams:`` `**`false`** - Append the current url's parameters to any links on the page. Useful for passing affiliate tracking or UTM data to subsequent pages

  * `linkExclusions`: `[]` - Array of strings of element selectors that should be ignored for link modification (preserve params, etc.). This is useful for issues with SpiffyJS messing with other scripts on your site.

## Example Config

This should be added **before** `spiffy.load()` in your SpiffyJS code.

```javascript
spiffy.config({
    // Enables div version of components
    compatibilityMode: true,

    // Tracking Options
    trackingEnabled: true,
    preserveUrlParams: false,
    linkExclusions: [],

    // Checkout Options
    hideSummary: false,
    hideCoupon: false,
    hideSidebar: true,
    hideHeader: true,
    hideFooter: true,
    
    // Portal Options
    hidePortalCustomer: false,
    hidePortalHeader: false,
    hidePortalSubscriptions: false,
    hidePortalPaymentPlans: false,
    hidePortalOrders: false,
    hidePortalLogout: false,

    // Takeover Options
    pageTakeover: true, // Used to easily turn both takeover settings on
    upsellPageTakeover: true,
    thanksPageTakeover: true,

    // Popup Options
    popupEnabled: true,
    popupPrefetch: true,
})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.spiffy.co/spiffyjs/config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
