@getcredify/credify-insurance-widget 1.4.0 → 1.5.1

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
@@ -12,12 +12,16 @@ npm install @getcredify/credify-insurance-widget
12
12
 
13
13
  ### Peer Dependencies
14
14
 
15
- This package requires React 19+ as a peer dependency:
15
+ This package requires React 18+ or React 19+ as a peer dependency:
16
16
 
17
17
  ```bash
18
+ npm install react@^18.0.0 react-dom@^18.0.0
19
+ # or
18
20
  npm install react@^19.0.0 react-dom@^19.0.0
19
21
  ```
20
22
 
23
+ **Note:** The widget is compatible with React 18.x and 19.x. React is not bundled with the widget, so your application must provide it. The library build externalizes all React entry points (`react`, `react-dom`, `react-dom/client`, `react/jsx-runtime`), so the host must provide a single React/React-DOM (18.x or 19.x). The widget uses React 18+ APIs (like `createRoot` from `react-dom/client`), which are available in both React 18 and 19.
24
+
21
25
  ### For Local Development
22
26
 
23
27
  ```bash
@@ -95,8 +99,16 @@ Include the widget as a script tag on your page:
95
99
  <head>
96
100
  <script src="https://widget.getcredify.com/index.umd.js"></script>
97
101
  <!-- Also include React and ReactDOM if not already present -->
98
- <script src="https://unpkg.com/react@19/umd/react.production.min.js"></script>
99
- <script src="https://unpkg.com/react-dom@19/umd/react-dom.production.min.js"></script>
102
+ <!-- For React 18: Use UMD builds -->
103
+ <script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
104
+ <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
105
+ <!-- For React 19: Use ESM (no UMD builds available) -->
106
+ <!-- <script type="module">
107
+ import React from 'https://esm.sh/react@19';
108
+ import ReactDOM from 'https://esm.sh/react-dom@19';
109
+ window.React = React;
110
+ window.ReactDOM = ReactDOM;
111
+ </script> -->
100
112
  </head>
101
113
  <body>
102
114
  <button onclick="window.CredifyInsuranceWidget.open()">Open Widget</button>
@@ -234,7 +246,11 @@ The simplest way to integrate the widget is to embed it directly in your page an
234
246
  <head>
235
247
  <title>My Page</title>
236
248
  <!-- Load React and ReactDOM (required peer dependencies) -->
237
- <!-- Note: React 19 doesn't have UMD builds, so we use ESM and expose as globals -->
249
+ <!-- For React 18: Use UMD builds -->
250
+ <!-- <script src="https://unpkg.com/react@18/umd/react.production.min.js"></script> -->
251
+ <!-- <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script> -->
252
+
253
+ <!-- For React 19: Use ESM (no UMD builds available) -->
238
254
  <script type="module">
239
255
  // Import React 19 as ESM modules - use exact same version for both
240
256
  import React from 'https://esm.sh/react@19.1.1';