coinley-pay 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,36 @@
1
- # React + Vite
1
+ # coinley-pay
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ React and vanilla JavaScript SDK for Coinley checkout.
4
4
 
5
- Currently, two official plugins are available:
5
+ ## React / Vite Install
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7
+ Use the package ESM entry for React apps:
8
+
9
+ ```jsx
10
+ import { CoinleyPayment } from 'coinley-pay';
11
+ import 'coinley-pay/dist/style.css';
12
+ ```
13
+
14
+ The React checkout is lazy-loaded from the root entry, so Vite apps do not pull
15
+ the full wallet/payment stack into the initial application chunk.
16
+
17
+ ## PWA Builds
18
+
19
+ The SDK ESM build is split into smaller chunks so `vite-plugin-pwa` can precache
20
+ it with Workbox's default 2 MiB per-file limit. In the current build, the largest
21
+ React checkout chunk is about 1.3 MB minified.
22
+
23
+ Do not import the standalone vanilla CDN bundle in React/Vite apps. The vanilla
24
+ bundle is intentionally self-contained for script-tag usage and is much larger
25
+ than the split ESM build.
26
+
27
+ If an app intentionally uses the standalone vanilla bundle with PWA precaching,
28
+ configure Workbox explicitly:
29
+
30
+ ```js
31
+ VitePWA({
32
+ workbox: {
33
+ maximumFileSizeToCacheInBytes: 7 * 1024 * 1024
34
+ }
35
+ })
36
+ ```