priceos 1.0.26 → 1.0.30
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 +7 -7
- package/dist/{chunk-VKNB5K6D.js → chunk-M6XZYMJ4.js} +407 -112
- package/dist/chunk-M6XZYMJ4.js.map +1 -0
- package/dist/client.d.ts +16 -1
- package/dist/embed/pricing-table.global.js +66 -8
- package/dist/gen/openapi.d.ts +2331 -691
- package/dist/index.cjs +406 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/next.cjs +508 -188
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.ts +10 -5
- package/dist/next.js +103 -78
- package/dist/next.js.map +1 -1
- package/dist/react.cjs +488 -155
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.ts +14 -12
- package/dist/react.js +488 -155
- package/dist/react.js.map +1 -1
- package/dist/types.d.ts +27 -7
- package/package.json +6 -1
- package/dist/chunk-VKNB5K6D.js.map +0 -1
package/README.md
CHANGED
|
@@ -72,9 +72,9 @@ App Router:
|
|
|
72
72
|
import { priceosHandler } from "priceos/next";
|
|
73
73
|
|
|
74
74
|
export const { GET, POST } = priceosHandler({
|
|
75
|
-
|
|
76
|
-
// resolve your current user/customer
|
|
77
|
-
return "customer_123";
|
|
75
|
+
identifyCustomer: async (request: Request) => {
|
|
76
|
+
// resolve your current user/customer identity
|
|
77
|
+
return { customerId: "customer_123" };
|
|
78
78
|
},
|
|
79
79
|
});
|
|
80
80
|
```
|
|
@@ -86,8 +86,8 @@ Pages Router:
|
|
|
86
86
|
import { priceosPagesHandler, type PriceOSPagesRequest } from "priceos/next";
|
|
87
87
|
|
|
88
88
|
export default priceosPagesHandler({
|
|
89
|
-
|
|
90
|
-
return "customer_123";
|
|
89
|
+
identifyCustomer: async (_req: PriceOSPagesRequest) => {
|
|
90
|
+
return { customerId: "customer_123" };
|
|
91
91
|
},
|
|
92
92
|
});
|
|
93
93
|
```
|
|
@@ -147,7 +147,7 @@ import { useCheckout } from "priceos/react";
|
|
|
147
147
|
|
|
148
148
|
const { openCheckout } = useCheckout();
|
|
149
149
|
await openCheckout({
|
|
150
|
-
|
|
150
|
+
productKey: "starter_monthly",
|
|
151
151
|
successUrl: "https://app.acme.com/settings/billing?checkout=success",
|
|
152
152
|
cancelUrl: "https://app.acme.com/settings/billing?checkout=canceled",
|
|
153
153
|
});
|
|
@@ -167,7 +167,7 @@ await openCustomerPortal();
|
|
|
167
167
|
`PriceOS` client groups:
|
|
168
168
|
- `customers`: `get`, `link`, `create`, `update`, `delete`
|
|
169
169
|
- `features`: `getAccess(customerId, featureKey?)`
|
|
170
|
-
- `products`: `list()`
|
|
170
|
+
- `products`: `list()`, `get(productKey)`
|
|
171
171
|
- `usage`: `track`, `set`, `getEvent`, `updateEvent`, `deleteEvent`, `deleteEvents`, `trackBatch`, `listEvents`
|
|
172
172
|
- `bonuses`: `create`, `list`, `update`, `delete`
|
|
173
173
|
|