@simpoobusiness/sdk 2.0.72 → 2.0.73
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,89 +1,89 @@
|
|
|
1
|
-
# Simpoo SDK
|
|
2
|
-
|
|
3
|
-
Simpoo SDK allows you to embed inventory widgets into **any website** (HTML, PHP, Next.js, WordPress, etc.) with **just a script**.
|
|
4
|
-
No npm installation is required.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 🚀 Quick Start
|
|
9
|
-
|
|
10
|
-
### Include SDK in Your Website
|
|
11
|
-
|
|
12
|
-
Add these tags inside your `<head>` or before `</body>`:
|
|
13
|
-
|
|
14
|
-
```html
|
|
15
|
-
<script src="https://unpkg.com/@simpoobusiness/sdk/dist/simpoo-sdk.js"></script>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Add a container where you want the inventory widget to appear:
|
|
19
|
-
|
|
20
|
-
```html
|
|
21
|
-
<div id="inventory-widget"></div>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Then initialize and render the widget:
|
|
25
|
-
Preferrably before the the closing tag `</body> of the page`
|
|
26
|
-
|
|
27
|
-
```html
|
|
28
|
-
<script>
|
|
29
|
-
SimpooSDK.init({ apiKey: "YOUR_API_KEY" });
|
|
30
|
-
SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
31
|
-
</script>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
✅ **That's it!** The widget will load with full styling.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## 📦 CDN Files
|
|
39
|
-
|
|
40
|
-
- `simpoo-sdk.js` → Main SDK script (React included).
|
|
41
|
-
- `simpoo-sdk.css` → Styles for inventory components.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## ⚙️ API Reference
|
|
46
|
-
|
|
47
|
-
### **SimpooSDK.init(config)**
|
|
48
|
-
|
|
49
|
-
Initialize the SDK with your configuration.
|
|
50
|
-
|
|
51
|
-
**Parameters:**
|
|
52
|
-
|
|
53
|
-
- `config.apiKey` (string) – Your API key.
|
|
54
|
-
|
|
55
|
-
**Example:**
|
|
56
|
-
|
|
57
|
-
```js
|
|
58
|
-
SimpooSDK.init({ apiKey: "12345" });
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
### **SimpooSDK.renderWidget(widget_name, selector)**
|
|
64
|
-
|
|
65
|
-
Render the inventory widget in a container.
|
|
66
|
-
|
|
67
|
-
**Parameters:**
|
|
68
|
-
|
|
69
|
-
- `widget_name` (string) – name for the inventory widget.
|
|
70
|
-
- `selector` (string) – CSS selector for the container.
|
|
71
|
-
|
|
72
|
-
**Example:**
|
|
73
|
-
|
|
74
|
-
```js
|
|
75
|
-
SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 🔍 Troubleshooting
|
|
81
|
-
|
|
82
|
-
- **Widget not rendering?**
|
|
83
|
-
Ensure the container `<div>` exists and the selector matches.
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
## 📄 License
|
|
88
|
-
|
|
89
|
-
MIT
|
|
1
|
+
# Simpoo SDK
|
|
2
|
+
|
|
3
|
+
Simpoo SDK allows you to embed inventory widgets into **any website** (HTML, PHP, Next.js, WordPress, etc.) with **just a script**.
|
|
4
|
+
No npm installation is required.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 🚀 Quick Start
|
|
9
|
+
|
|
10
|
+
### Include SDK in Your Website
|
|
11
|
+
|
|
12
|
+
Add these tags inside your `<head>` or before `</body>`:
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<script src="https://unpkg.com/@simpoobusiness/sdk/dist/simpoo-sdk.js"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Add a container where you want the inventory widget to appear:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<div id="inventory-widget"></div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then initialize and render the widget:
|
|
25
|
+
Preferrably before the the closing tag `</body> of the page`
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<script>
|
|
29
|
+
SimpooSDK.init({ apiKey: "YOUR_API_KEY" });
|
|
30
|
+
SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
31
|
+
</script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
✅ **That's it!** The widget will load with full styling.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 📦 CDN Files
|
|
39
|
+
|
|
40
|
+
- `simpoo-sdk.js` → Main SDK script (React included).
|
|
41
|
+
- `simpoo-sdk.css` → Styles for inventory components.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## ⚙️ API Reference
|
|
46
|
+
|
|
47
|
+
### **SimpooSDK.init(config)**
|
|
48
|
+
|
|
49
|
+
Initialize the SDK with your configuration.
|
|
50
|
+
|
|
51
|
+
**Parameters:**
|
|
52
|
+
|
|
53
|
+
- `config.apiKey` (string) – Your API key.
|
|
54
|
+
|
|
55
|
+
**Example:**
|
|
56
|
+
|
|
57
|
+
```js
|
|
58
|
+
SimpooSDK.init({ apiKey: "12345" });
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### **SimpooSDK.renderWidget(widget_name, selector)**
|
|
64
|
+
|
|
65
|
+
Render the inventory widget in a container.
|
|
66
|
+
|
|
67
|
+
**Parameters:**
|
|
68
|
+
|
|
69
|
+
- `widget_name` (string) – name for the inventory widget.
|
|
70
|
+
- `selector` (string) – CSS selector for the container.
|
|
71
|
+
|
|
72
|
+
**Example:**
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
SimpooSDK.renderWidget("inventory", "#inventory-widget");
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 🔍 Troubleshooting
|
|
81
|
+
|
|
82
|
+
- **Widget not rendering?**
|
|
83
|
+
Ensure the container `<div>` exists and the selector matches.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 📄 License
|
|
88
|
+
|
|
89
|
+
MIT
|