Skip to content

Commit 3c598c1

Browse files
committed
make jsdelivr support explicit
1 parent aa28a03 commit 3c598c1

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,21 @@ function MyApp() {
9898
</script>
9999
```
100100

101+
### Direct Deployment via jsDelivr CDN
102+
103+
For websites that don't use npm packages, you can directly include the ACCESS Q&A Bot using jsDelivr CDN:
104+
105+
```html
106+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/css/main.css">
107+
<div style="display:none;" id="qa-bot">
108+
&nbsp;
109+
</div>
110+
<script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/main.js"></script>
111+
<script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/453.chunk.js"></script>
112+
```
113+
114+
Replace `v0.2.0` with the specific version you want to use. This method provides the React version of the bot and automatically initializes it when the page loads.
115+
101116
## Properties
102117

103118
| Property | Type | Description |

index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ <h1>ACCESS Q&A Bot Standalone Demo</h1>
4848
<div class="explanation">
4949
<p>This page demonstrates how to integrate the ACCESS Q&A Bot in different ways using the pre-built files.
5050
No React framework setup is needed - just include the CSS and JS files from the build directory, or from the CDN.</p>
51+
<p>You can use either the <strong>jsDelivr CDN</strong> (direct from GitHub repository) or <strong>unpkg CDN</strong> (from npm package):</p>
52+
<pre>
53+
<!-- jsDelivr CDN (direct from GitHub) -->
54+
&lt;link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/css/main.css"&gt;
55+
&lt;div id="qa-bot"&gt;&lt;/div&gt;
56+
&lt;script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/main.js"&gt;&lt;/script&gt;
57+
&lt;script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/453.chunk.js"&gt;&lt;/script&gt;
58+
59+
<!-- OR unpkg CDN (from npm package) -->
60+
&lt;script src="https://unpkg.com/@snf/[email protected]/dist/access-qa-bot.standalone.js"&gt;&lt;/script&gt;
61+
&lt;access-qa-bot welcome="Hello!" prompt="Ask me anything..."&gt;&lt;/access-qa-bot&gt;
62+
</pre>
5163
</div>
5264

5365
<div class="demo-section">

publishing.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,19 @@ https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/main.js
142142

143143
The version number in these URLs must match git tags in our repository. Never reuse a version number that already has a tag to avoid breaking existing CDN links.
144144

145+
A complete jsDelivr implementation typically requires three files:
146+
```html
147+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/css/main.css">
148+
<div id="qa-bot"></div>
149+
<script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/main.js"></script>
150+
<script src="https://cdn.jsdelivr.net/gh/necyberteam/[email protected]/build/static/js/453.chunk.js"></script>
151+
```
152+
153+
**Important:** When updating the package:
154+
1. Make sure these file paths remain consistent
155+
2. Test all jsDelivr URLs after updating
156+
3. Remember that the chunk filename (like 453.chunk.js) may change in future builds
157+
145158
### 2. unpkg CDN (npm-based, Secondary)
146159

147160
After publishing to npm, the package will also be available via unpkg:

0 commit comments

Comments
 (0)