# CXF plugin for Canvas shop

This plugin integrates the Canvas shop into the games (BigFarm, Empire, E4k).

### Enable Canvas Agent in browser

To enable Canvas Agent you need to add `cxf_canvas` flag to your localstorage.
Open browser console and run

```js
localStorage.cxf_canvas = 'enabled'
```

It also disables the Lemonstand webshop.

## How-to

### How to publish QA version for testing

Check `version`in package.json and increase version (like 1.0.0-qa.7 -> 1.0.0-qa.8) if it's requires. Then run:

```shell
pnpm publish:qa --no-git-checks
```

### Enable DEBUG messages

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

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

```js
localStorage.debug = 'CXF:*,CANVAS-AGENT:*'
```

### Start locally

```bash
# one time
pnpm install

pnpm start
```

Open http://localhost:3000 in your browser

### Run test

```bash
# run once
pnpm dlx puppeteer browsers install chrome
# run unit tests
pnpm test

```
