@gemmein/sdk 0.3.0 → 0.3.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/llms.txt +36 -21
- package/package.json +2 -2
package/llms.txt
CHANGED
|
@@ -185,28 +185,43 @@
|
|
|
185
185
|
arriving out of order resolve to the newest. The app reads
|
|
186
186
|
`await g.subscriptions.mine()` → `{ plan, status }` or null, and gates features
|
|
187
187
|
with `sub?.plan === "pro"`.
|
|
188
|
-
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
`
|
|
188
|
+
- Paid ACCESS (entitlements): a collection can require a key — your human
|
|
189
|
+
sets `requires: "access:pro"` in its settings — and the engine refuses
|
|
190
|
+
anyone without it, on every operation, under all seven rules. Keys are
|
|
191
|
+
granted by money: a plan or product lists what it unlocks (e.g.
|
|
192
|
+
`access:pro, access:exports`), the paid webhook grants those keys, and a
|
|
193
|
+
refund or cancellation revokes exactly what it granted — nothing else.
|
|
194
|
+
Owners also grant and revoke by hand (trials, comps, support). Effective
|
|
195
|
+
access is the UNION of a customer's live grants. A signed-in customer
|
|
196
|
+
without the key gets `403 entitlement_required` naming it — show your
|
|
197
|
+
upgrade screen and send them to checkout; never retry. Proof surfaces:
|
|
198
|
+
`await g.purchases.mine()` (everything they paid for, refunds applied,
|
|
199
|
+
with the `grants` each purchase carries) and `await g.subscriptions.mine()`.
|
|
200
|
+
NO credits, NO usage limits, NO seats — access is yes-or-no by design.
|
|
201
|
+
- Selling THINGS (one-off purchases — a beat, an ebook, a course; DIGITAL
|
|
202
|
+
access only — physical goods, shipping, inventory and carts are out of
|
|
203
|
+
scope, said out loud): plans are for subscriptions; products are for
|
|
204
|
+
things. The builder adds products (name + Stripe Payment Link) on the
|
|
205
|
+
same Payments page. The app calls
|
|
206
|
+
`await g.payments.buy("beat")` — or, when one product covers many items (license
|
|
193
207
|
tiers over a catalog), names the item:
|
|
194
|
-
`await g.payments.buy("premium license", { item: "beat_37" })` (display text
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
`await g.payments.buy("premium license", { item: "beat_37" })` (display text
|
|
209
|
+
only; the PRICE always comes from the product's Payment Link, so the
|
|
210
|
+
item note can never change what's paid). Gemmein records every completed
|
|
211
|
+
payment itself — `await g.purchases.mine()` is the buyer's proof:
|
|
212
|
+
{ item, kind, status: "paid"|"part_refunded"|"refunded", amountMinor,
|
|
213
|
+
currency, refundedMinor, grants, paidAt }. A receipts collection (rule
|
|
214
|
+
`addressed`) is OPTIONAL — add one when you want receipts as records the
|
|
215
|
+
app renders; only the buyer and the owner read them. Delivery: attach
|
|
216
|
+
the thing to the product — a sealed Gemmein file (the receipt carries a
|
|
217
|
+
`file:` ref; resolve it per reader with `g.files.link`, which re-checks
|
|
218
|
+
access on every mint) or an external `deliveryUrl` (a plain handover:
|
|
219
|
+
Gemmein controls who is TOLD, not who can use it). Gate fulfilment on
|
|
220
|
+
the purchase or the entitlement it granted, never on the redirect coming
|
|
221
|
+
back — redirects can be faked; the record comes from Stripe's signed
|
|
222
|
+
webhook. NO carts, NO quantities — one product per checkout by design; a
|
|
223
|
+
cart is N checkouts or one bundled product. 404 unknown_product lists
|
|
224
|
+
what the app actually sells — use those names.
|
|
210
225
|
- Drafts on PUBLIC collections (public_read, community): create with the
|
|
211
226
|
OPTION `{ published: false }` → hidden from every reader except its
|
|
212
227
|
author and the owner, server-enforced; publish with
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemmein/sdk",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Gemmein SDK
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Gemmein SDK — passwordless auth, safe storage, and Stripe-driven record flips for AI-built apps. Small enough that one prompt teaches the whole API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs",
|