# @goodgamestudios/cxf-webshop

This is the main CXF plugin/entry point handler for Lemonstand(IGS)

[CXF Documentation](https://confluence.goodgamestudios.com/display/SKUN/CXF)

## Structural overview
### 1. Preparing `store` with session and player info

- Waiting for login event
### 2. Constructing a lemonstand URL

- Parsing params
- Selecting static config file URL

### 3. Creating a dialog

- Opening lemonstand in an iframe

## Main events involved

| Event name                        |  Description 
|-----------------------------------|-----------------------------------
| cxf.igs.open                      | Open IGS command used by games
| cxf.dialog.close                  | Close IGS frame command
| cxf.native.subscription.enable    | Enable the allow subscriptions flag (deprecated – use config value)
| ~~cxf.webshop.sales.open~~        | Open a sales page directly (**deprecated**)
| cxf.set.customization.surfix     | _[yes, a typo]_ Set config suffix (context), e.g. `-temp` for temp servers, 
| cxf.adBanner.status               | Receive and process status of ads to propagate to lemonstand
| lemonstand.category.update        | Forward postMessage to a specific tab/iframe target
| lemonstand.notifs.created         | Handle activation of offer notifcations

## How-to
### enable DEBUG messages

Debug messages are implemented via [Debug lib](https://github.com/debug-js/debug)

To enable CXF-WEBSHOP debug messages just run in a browser console

```js 
localStorage.debug = 'CXF-WEBSHOP:*'
```

### customize config-goodgamestudios

This allows developers to publish their own version of the config and use it
on-the-fly with existing clients.

Just append the `configGGS` parameter, specifying the version you published.

E.g., having published a `config-goodgamestudios@green-eggs` version, the
parameter in the client URL would be `configGGS=green-eggs`.
