Fix action and constant counts and the Step 3 import path
This commit is contained in:
@@ -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:
|
||||
|
||||
- **"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.
|
||||
- **"Activate license"** — paste a key you got out-of-band.
|
||||
- **"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**.
|
||||
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.
|
||||
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
|
||||
|
||||
@@ -26,7 +28,7 @@ Copy these folders into your buyer-side package's `startos/` directory:
|
||||
|
||||
```
|
||||
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`:
|
||||
@@ -39,8 +41,10 @@ npm install @keysat/licensing-client
|
||||
|
||||
### 1. Fill in `startos/licensing/config.ts`
|
||||
|
||||
There are three constants to set: `LICENSING_BASE_URL`, `PRODUCT_SLUG`, and
|
||||
`ISSUER_PUBKEY_PEM`. Each is documented inline.
|
||||
There are four constants to set: `LICENSING_BASE_URL`, `PRODUCT_SLUG`,
|
||||
`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
|
||||
|
||||
@@ -64,7 +68,7 @@ export const initStore: StoreShape = {
|
||||
In `startos/actions/index.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()
|
||||
// ...your own actions...
|
||||
@@ -105,7 +109,7 @@ export const main = sdk.setupMain(async ({ effects, started }) => {
|
||||
## What the buyer sees
|
||||
|
||||
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:
|
||||
- Clicks **Buy license** → opens the returned URL → pays → clicks **Finish license purchase** → done.
|
||||
- Pastes a key they got from you into **Activate license** → done.
|
||||
|
||||
Reference in New Issue
Block a user