@versacommerce/versacommerce-js-sdk 0.5.1 → 0.6.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
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Frontend JavaScript SDK for VersaCommerce shops that allows you to access products, collections, pages, blogs, navigation, and carts from any website.
|
|
4
4
|
|
|
5
|
+
## Purpose: AI Agent Integration
|
|
6
|
+
|
|
7
|
+
This SDK serves as the **"eyes and hands"** for AI agents (like Claude) that can automatically build and customize online shops.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────┐ ┌─────────────┐ ┌─────────────────┐
|
|
11
|
+
│ AI Agent │ ───► │ JS-SDK │ ───► │ VersaCommerce │
|
|
12
|
+
│ (Claude) │ │ (this lib) │ │ Shop API │
|
|
13
|
+
│ │ ◄─── │ │ ◄─── │ │
|
|
14
|
+
│ "Build theme" │ data │ getShop() │ JSON │ /js-api/*.json │
|
|
15
|
+
│ │ │ getProducts │ │ │
|
|
16
|
+
└─────────────────┘ └─────────────┘ └─────────────────┘
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**The AI agent uses SDK to:**
|
|
20
|
+
|
|
21
|
+
- Read shop structure (`getShop()`)
|
|
22
|
+
- Get all products (`getProducts()`)
|
|
23
|
+
- Get collections (`getCollections()`)
|
|
24
|
+
- Get pages and navigation (`getPages()`, `getLinklists()`)
|
|
25
|
+
|
|
26
|
+
**Then the agent can:**
|
|
27
|
+
|
|
28
|
+
- Automatically generate themes
|
|
29
|
+
- Build navigation based on real data
|
|
30
|
+
- Create product pages
|
|
31
|
+
|
|
32
|
+
The SDK works **in the browser** (not server-side), so API endpoints must have CORS headers.
|
|
33
|
+
|
|
5
34
|
## Installation
|
|
6
35
|
|
|
7
36
|
```bash
|