Fix action and constant counts and the Step 3 import path

This commit is contained in:
Keysat
2026-06-17 15:24:55 -05:00
parent c19614c297
commit 0585d26e4b
+9 -5
View File
@@ -4,6 +4,7 @@ A drop-in folder that adds Keysat licensing to your existing Start9
(StartOS 0.4.0.x) package. Your buyers get: (StartOS 0.4.0.x) package. Your buyers get:
- **"Buy license"** — pay with Bitcoin/Lightning on your BTCPay, never copy/paste the key. Optional discount/referral code field. - **"Buy license"** — pay with Bitcoin/Lightning on your BTCPay, never copy/paste the key. Optional discount/referral code field.
- **"Finish license purchase"** — after the buyer pays, fetch the issued key and persist it locally.
- **"Redeem free license"** — paste a free-license code from the seller; key is issued immediately, no payment. - **"Redeem free license"** — paste a free-license code from the seller; key is issued immediately, no payment.
- **"Activate license"** — paste a key you got out-of-band. - **"Activate license"** — paste a key you got out-of-band.
- **"Check license status"** — re-verify on demand. - **"Check license status"** — re-verify on demand.
@@ -19,6 +20,7 @@ only when the device is online.
2. You have created a product in your Keysat and have its **slug**. 2. You have created a product in your Keysat and have its **slug**.
3. You know your Keysat's **public URL** (clearnet, .onion, or both). 3. You know your Keysat's **public URL** (clearnet, .onion, or both).
4. You have your Keysat's **Ed25519 public key in PEM form**. Get it from the "Show admin credentials" action on your Start9, or hit `GET /v1/pubkey` on your service. 4. You have your Keysat's **Ed25519 public key in PEM form**. Get it from the "Show admin credentials" action on your Start9, or hit `GET /v1/pubkey` on your service.
5. The action files import `sdk` from `'../sdk'` — a module you must provide. Point that path at (or alias it to) your package's own `@start9labs/start-sdk` singleton; otherwise the template won't compile.
## Install ## Install
@@ -26,7 +28,7 @@ Copy these folders into your buyer-side package's `startos/` directory:
``` ```
startos/licensing/ ← config, store shape, runtime gate startos/licensing/ ← config, store shape, runtime gate
startos/actions/ ← five actions (merge with your existing actions/) startos/actions/ ← six actions (merge with your existing actions/)
``` ```
Add the SDK to your package's `package.json`: Add the SDK to your package's `package.json`:
@@ -39,8 +41,10 @@ npm install @keysat/licensing-client
### 1. Fill in `startos/licensing/config.ts` ### 1. Fill in `startos/licensing/config.ts`
There are three constants to set: `LICENSING_BASE_URL`, `PRODUCT_SLUG`, and There are four constants to set: `LICENSING_BASE_URL`, `PRODUCT_SLUG`,
`ISSUER_PUBKEY_PEM`. Each is documented inline. `ISSUER_PUBKEY_PEM`, and `PRODUCT_DISPLAY_NAME`. Each is documented inline.
`PRODUCT_DISPLAY_NAME` is interpolated into every user-visible string, so
leaving it at the default is a real mistake, not a cosmetic one.
### 2. Extend your store shape ### 2. Extend your store shape
@@ -64,7 +68,7 @@ export const initStore: StoreShape = {
In `startos/actions/index.ts`: In `startos/actions/index.ts`:
```ts ```ts
import { licensingActions } from './licensing-actions' // or wherever you dropped them import { licensingActions } from './licensing/actions' // or wherever you dropped them
export const actions = sdk.Actions.of() export const actions = sdk.Actions.of()
// ...your own actions... // ...your own actions...
@@ -105,7 +109,7 @@ export const main = sdk.setupMain(async ({ effects, started }) => {
## What the buyer sees ## What the buyer sees
1. Installs your package on their Start9. 1. Installs your package on their Start9.
2. Sees four new actions in the dashboard under the "License" group. 2. Sees six new actions in the dashboard under the "License" group.
3. Either: 3. Either:
- Clicks **Buy license** → opens the returned URL → pays → clicks **Finish license purchase** → done. - Clicks **Buy license** → opens the returned URL → pays → clicks **Finish license purchase** → done.
- Pastes a key they got from you into **Activate license** → done. - Pastes a key they got from you into **Activate license** → done.