@dsrcjs/ai-widget 1.0.9 → 1.0.11

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
@@ -21,8 +21,10 @@ modifying, reverse-engineering and redistributing it are not.
21
21
 
22
22
  ### `<script>` tag
23
23
 
24
- One tag, no build step. `@1` always carries the current release of the major version: each release clears the
25
- jsDelivr cache, so it reaches your page within minutes, nothing to bump on your side:
24
+ One tag, no build step. `@1` always carries the current release of the major version, nothing to bump on your side.
25
+ Browsers keep a jsDelivr range like `@1` cached for up to a week, so the widget checks itself on start: it asks
26
+ jsDelivr (`data.jsdelivr.com`, cached 5 minutes) which version `@1` points to now and, if the cached copy is older,
27
+ loads that exact version instead. A release reaches every visitor within minutes:
26
28
 
27
29
  ```html
28
30
  <script src="https://cdn.jsdelivr.net/npm/@dsrcjs/ai-widget@1/dist/ai-dana-chat.js" defer></script>
@@ -35,6 +37,10 @@ Want to pin a version instead? The same file by exact version never changes and
35
37
  <script src="https://cdn.jsdelivr.net/npm/@dsrcjs/ai-widget@1.0.7/dist/ai-dana-chat.js" defer></script>
36
38
  ```
37
39
 
40
+ If your site has a Content-Security-Policy, the widget needs: `script-src https://cdn.jsdelivr.net`,
41
+ `connect-src https://data.jsdelivr.com https://dev-ai.kgd.gov.kz`, `img-src https://dev-ai.kgd.gov.kz blob: data:`,
42
+ `style-src 'unsafe-inline'`. Without `data.jsdelivr.com` the widget still works, it just updates with the browser cache.
43
+
38
44
  Do not put `integrity="…"` (SRI) on the rolling address: the hash is tied to the bytes of one release, and the next
39
45
  one would stop your page loading the widget. Pin a version if you need SRI.
40
46