@betterstore/sdk 0.1.0 → 0.1.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/CHANGELOG.md +6 -0
- package/README.md +8 -17
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
# Better Store SDK
|
|
2
2
|
|
|
3
|
-
🚀 **Better Store SDK** is a modern, developer-friendly
|
|
4
|
-
|
|
5
|
-
## ✨ Features
|
|
6
|
-
|
|
7
|
-
- 🛒 **Custom Checkout** – Build checkout flows that suit your business needs.
|
|
8
|
-
- 💳 **Payments** – Integrate with Stripe, PayPal, and custom gateways.
|
|
9
|
-
- 📦 **Product & Order Management** – API-driven store management.
|
|
10
|
-
- 🎨 **Customizable UI** – Prebuilt components and themes.
|
|
11
|
-
- 📡 **Webhooks & API Events** – Extend and automate eCommerce operations.
|
|
12
|
-
- 🚀 **Optimized for DX** – Built with TypeScript and fully documented.
|
|
3
|
+
🚀 **Better Store SDK** is a modern, developer-friendly sdk toolkit designed to help developers build flexible and powerful e-commerce stores with ease.
|
|
13
4
|
|
|
14
5
|
## 📦 Installation
|
|
15
6
|
|
|
16
7
|
```sh
|
|
17
|
-
npm install
|
|
8
|
+
npm install @betterstore/sdk
|
|
18
9
|
```
|
|
19
10
|
|
|
20
11
|
## 🚀 Quick Start
|
|
21
12
|
|
|
22
13
|
```javascript
|
|
23
|
-
import { BetterStore } from "
|
|
14
|
+
import { BetterStore } from "@betterstore/sdk";
|
|
24
15
|
|
|
25
|
-
const
|
|
16
|
+
const betterStore = new BetterStore("YOUR_API_KEY");
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
betterStore.checkout.create({
|
|
19
|
+
type: "hosted",
|
|
20
|
+
lineItems: [{ productId: "example_id", quantity: 1 }],
|
|
30
21
|
});
|
|
31
22
|
```
|
|
32
23
|
|
|
33
24
|
## 📚 Documentation
|
|
34
25
|
|
|
35
|
-
Full documentation is available at **[betterstore.
|
|
26
|
+
Full documentation is available at **[betterstore.io](https://betterstore.io)**.
|
|
36
27
|
|
|
37
28
|
## 🤝 Contributing
|
|
38
29
|
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -69,9 +69,10 @@ var Checkout = class {
|
|
|
69
69
|
create(params) {
|
|
70
70
|
return __async(this, null, function* () {
|
|
71
71
|
const lineItems = params.line_items.map((item) => {
|
|
72
|
-
var _a;
|
|
72
|
+
var _a, _b;
|
|
73
73
|
return __spreadProps(__spreadValues({}, item), {
|
|
74
|
-
|
|
74
|
+
quantity: ((_a = item.quantity) != null ? _a : 1) > 0 ? item.quantity : 1,
|
|
75
|
+
variant_options: (_b = item.variantOptions) != null ? _b : []
|
|
75
76
|
});
|
|
76
77
|
});
|
|
77
78
|
const response = yield fetch("https://betterstore.io/api/checkout", {
|
package/dist/index.mjs
CHANGED
|
@@ -46,9 +46,10 @@ var Checkout = class {
|
|
|
46
46
|
create(params) {
|
|
47
47
|
return __async(this, null, function* () {
|
|
48
48
|
const lineItems = params.line_items.map((item) => {
|
|
49
|
-
var _a;
|
|
49
|
+
var _a, _b;
|
|
50
50
|
return __spreadProps(__spreadValues({}, item), {
|
|
51
|
-
|
|
51
|
+
quantity: ((_a = item.quantity) != null ? _a : 1) > 0 ? item.quantity : 1,
|
|
52
|
+
variant_options: (_b = item.variantOptions) != null ? _b : []
|
|
52
53
|
});
|
|
53
54
|
});
|
|
54
55
|
const response = yield fetch("https://betterstore.io/api/checkout", {
|