# coinley-pay

React and vanilla JavaScript SDK for Coinley checkout.

## React / Vite Install

Use the package ESM entry for React apps:

```jsx
import { CoinleyPayment } from 'coinley-pay';
import 'coinley-pay/dist/style.css';
```

The React checkout is lazy-loaded from the root entry, so Vite apps do not pull
the full wallet/payment stack into the initial application chunk.

## PWA Builds

The SDK ESM build is split into smaller chunks so `vite-plugin-pwa` can precache
it with Workbox's default 2 MiB per-file limit. In the current build, the largest
React checkout chunk is about 1.3 MB minified.

Do not import the standalone vanilla CDN bundle in React/Vite apps. The vanilla
bundle is intentionally self-contained for script-tag usage and is much larger
than the split ESM build.

If an app intentionally uses the standalone vanilla bundle with PWA precaching,
configure Workbox explicitly:

```js
VitePWA({
  workbox: {
    maximumFileSizeToCacheInBytes: 7 * 1024 * 1024
  }
})
```
