@lukoweb/apitogo 0.1.77 → 0.1.79

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.
@@ -57,8 +57,8 @@ metadata, with optional `.env` overrides for secrets and local tweaks.
57
57
  - **Site name / logo:** only `site.title` and `site.logo` (platform branding is derived at publish).
58
58
  - **OpenAPI path:** `backend.openApiPath` is derived from `apis[0].input`.
59
59
  - **Billing / account plans:** use `modules.userPanel.plans.enabled` and store the plan catalog in
60
- `modules.userPanel.plans.items`. Legacy root `plans` is migrated on load. Legacy `pricing.enabled`
61
- is migrated and stripped from site JSON; MCP/publish still receives derived `pricing.enabled`.
60
+ `modules.userPanel.plans.items`. Add plans with `apitogo config -i` or edit the manifest by hand.
61
+ See [Gateway plans](./plans.md). Legacy root `plans` is migrated on load.
62
62
  - **Docs / API keys:** configure under `modules.docs` and `modules.userPanel.apiKeys` only.
63
63
 
64
64
  ## Environment variables
@@ -90,6 +90,7 @@ APITOGO_CONFIG_AUTHENTICATION__STRIPE__WEBHOOK_SECRET=whsec_...
90
90
 
91
91
  ## Related
92
92
 
93
+ - [Gateway plans](./plans.md)
93
94
  - [Authentication](./authentication.md)
94
95
  - [Overview](./overview.md)
95
96
  - [MCP overview](../mcp/overview.md)
@@ -160,6 +160,8 @@ Put navigation in `apitogo.config.json`, or keep large trees in a separate modul
160
160
  ## Related
161
161
 
162
162
  - [Manifest (`apitogo.config.json`)](./manifest.md)
163
- - [Make config (CLI)](./make-config.mdx)
163
+ - [Make config (CLI)](./make-config.mdx) — interactive wizard (`apitogo config -i`)
164
+ - [Gateway plans](./plans.md)
164
165
  - [Authentication](./authentication.md)
165
166
  - [MCP overview](../mcp/overview.md)
167
+ - [Shape with CLI](../cli/shape.md)
@@ -0,0 +1,113 @@
1
+ ---
2
+ title: Gateway plans
3
+ sidebar_icon: tags
4
+ description:
5
+ Configure end-user API plans in apitogo.config.json — pricing, rate limits, quotas, and publish
6
+ behavior.
7
+ ---
8
+
9
+ **Gateway plans** (also called API plans) are what your **end users** subscribe to on `/pricing`.
10
+ They are separate from **platform hosting** (Free / Starter / Professional on APItoGo), which you
11
+ select with `apitogo apply --platform-plan`.
12
+
13
+ Store the catalog under `modules.userPanel.plans.items` in `apitogo.config.json`.
14
+
15
+ ## Shape with the CLI
16
+
17
+ `apitogo config -i` can add plans interactively (title, price, rate limit, monthly quota). You can
18
+ also edit the manifest by hand or use MCP `update_dev_portal_manifest`.
19
+
20
+ ```bash
21
+ npx apitogo config -i
22
+ # loop: plan → enter title, price, policies → done
23
+ ```
24
+
25
+ ## Canonical shape
26
+
27
+ ```json
28
+ {
29
+ "modules": {
30
+ "userPanel": {
31
+ "plans": {
32
+ "enabled": true,
33
+ "items": [
34
+ {
35
+ "sku": "free",
36
+ "displayName": "Free",
37
+ "priceAmount": 0,
38
+ "limitsJson": "{\"rateLimit\":{\"calls\":100,\"renewalPeriodSeconds\":60},\"quota\":{\"calls\":50000,\"renewalPeriodDays\":30}}"
39
+ },
40
+ {
41
+ "sku": "pro",
42
+ "displayName": "Pro",
43
+ "priceAmount": 29,
44
+ "priceCurrency": "usd",
45
+ "billingPeriod": "month",
46
+ "limitsJson": "{\"rateLimit\":{\"calls\":1000,\"renewalPeriodSeconds\":60},\"quota\":{\"calls\":500000,\"renewalPeriodDays\":30}}"
47
+ }
48
+ ]
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ - **`sku`** — stable identifier (used in checkout URLs and gateway sync).
56
+ - **`displayName`** — label on `/pricing`.
57
+ - **`priceAmount`** — `0` for free tiers; greater than zero for paid plans (USD by default).
58
+ - **`limitsJson`** — JSON string with rate limit and quota policies (see below).
59
+
60
+ Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
61
+ load.
62
+
63
+ ## limitsJson schema
64
+
65
+ ```json
66
+ {
67
+ "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
68
+ "quota": { "calls": 50000, "renewalPeriodDays": 30 }
69
+ }
70
+ ```
71
+
72
+ - **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
73
+ - **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
74
+
75
+ After OpenAPI is deployed, you can scope plans to specific API operations with
76
+ `includedActionKeys` (for example `get:/orders/{id}`). Edit those fields in
77
+ `apitogo.config.json` — see [Manifest](./manifest.md).
78
+
79
+ ## Publish
80
+
81
+ Gateway plans are applied when you run:
82
+
83
+ ```bash
84
+ apitogo apply
85
+ ```
86
+
87
+ `apitogo apply` syncs plans from the manifest to the platform gateway. Paid plans require Stripe
88
+ secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
89
+
90
+ ## Platform hosting vs gateway plans
91
+
92
+ | Kind | What it is | How |
93
+ | ---- | ---------- | --- |
94
+ | **Platform hosting** | APItoGo bill for hosting your portal + API hub | `apitogo apply --platform-plan` |
95
+ | **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
96
+
97
+ ### Free platform limitations
98
+
99
+ The **Free** platform plan cannot:
100
+
101
+ - Publish **paid** gateway plans (`priceAmount > 0`)
102
+ - Attach a **custom domain** to the dev portal
103
+
104
+ Use **Starter** or **Professional** for paid API tiers, Stripe checkout, and custom domains. If your
105
+ manifest has paid plans and you try `apitogo apply --platform-plan free`, apply is blocked until you
106
+ upgrade or zero/remove those paid plans.
107
+
108
+ ## Related
109
+
110
+ - [Manifest](./manifest.md)
111
+ - [Make config (CLI)](./make-config.mdx)
112
+ - [Authentication](./authentication.md)
113
+ - [Go live with CLI](../cli/go-live.md)
@@ -1,145 +1,17 @@
1
- ---
2
- title: Deploy with APIToGo CLI
3
- ---
1
+ # Deploy with APIToGo CLI
4
2
 
5
- [APIToGo](https://apitogo.com) hosts your documentation site. This page covers the **CLI** path
6
- (`apitogo deploy` with a deployment token).
3
+ Platform publish is **`apitogo apply`** — the same engine as MCP `publish_dev_portal`.
7
4
 
8
- For a full API product (plans, `dev-portal` auth, gateway, platform Free / Starter / Professional),
9
- use MCP **`publish_dev_portal`** / `apply_product_intent` mode `goLive` — see
10
- [MCP go-live](../mcp/go-live.md).
5
+ Full walkthrough (prerequisites, secrets, `--only`, status, teardown):
11
6
 
12
- | Path | When |
13
- | ------------------------ | ------------------------------------------------- |
14
- | MCP `publish_dev_portal` | Connected portal + plans + hosting go-live |
15
- | CLI `apitogo deploy` | Build and upload a site with a deployment token |
7
+ → **[Go live with CLI](../cli/go-live.md)**
16
8
 
17
- ## Before you deploy
9
+ Quick reference:
18
10
 
19
11
  ```bash
20
- npm run dev
12
+ export APITOGO_API_KEY_ID=apk_...
13
+ export APITOGO_API_SECRET=...
14
+ cd ./my-portal
15
+ apitogo apply --platform-plan free
16
+ apitogo status
21
17
  ```
22
-
23
- ## Deploy with the CLI
24
-
25
- To publish a site with a deployment token:
26
-
27
- 1. Sign in to [apitogo.com](https://apitogo.com)
28
- 2. Create a new project or open an existing one
29
- 3. Navigate to Project settings and copy the deployment token
30
- 4. Run the following command:
31
-
32
- ```bash
33
- apitogo deploy --deployment-token=<TOKEN> --env=<environment-name>
34
- ```
35
-
36
- The `--env` value is the **environment name** your deploy server uses. It must match what is
37
- configured for your project (see the APIToGo dashboard / deploy API).
38
-
39
- Common patterns:
40
-
41
- - **`production`** — main live site (default when `--env` is omitted)
42
- - **Named non-production environments** — any label your backend accepts, for example `staging`,
43
- `dev`, or `preview`
44
- - **Multiple preview slots** — separate previews such as `preview-a` and `preview-b` when your
45
- `/deploy` endpoint supports them:
46
-
47
- ```bash
48
- apitogo deploy --deployment-token=<TOKEN> --env=preview-a
49
- apitogo deploy --deployment-token=<TOKEN> --env=preview-b
50
- ```
51
-
52
- If you do not provide `--env`, APIToGo deploys to `production` by default:
53
-
54
- ```bash
55
- apitogo deploy --deployment-token=<TOKEN>
56
- ```
57
-
58
- ### JSON-only mode (`--json-only`)
59
-
60
- Use `--json-only` when you want **machine-readable output** from the whole command (for example
61
- piping to `jq` in CI).
62
-
63
- - **Standard output** is a **single JSON value**: on success, the parsed deploy API response (the
64
- same payload the server returns with `?jsonOnly=true`). On failure (including build errors),
65
- stdout is `{"error":"..."}` and the process exits with a non-zero code.
66
- - The CLI **suppresses** normal build and progress logs so they do not mix with that JSON.
67
- - The deploy request still includes `?jsonOnly=true` on the endpoint.
68
-
69
- ```bash
70
- apitogo deploy --deployment-token=<TOKEN> --json-only
71
- ```
72
-
73
- Combine with `--env` as usual (including named previews such as `preview-a`):
74
-
75
- ```bash
76
- apitogo deploy --deployment-token=<TOKEN> --env=preview --json-only
77
- apitogo deploy --deployment-token=<TOKEN> --env=preview-a --json-only
78
- ```
79
-
80
- ## Deploy with GitHub Actions
81
-
82
- You can automate deploys from GitHub so every merge to `main` updates production and every pull
83
- request gets a **preview** URL.
84
-
85
- ### 1. Generate the workflow
86
-
87
- From your documentation project root (the folder that contains `apitogo.config.json` and `package.json`),
88
- run:
89
-
90
- ```bash
91
- apitogo configure-github-workflow
92
- ```
93
-
94
- This creates `.github/workflows/apitogo-deploy.yml` with two jobs:
95
-
96
- - **Preview** — runs on pull requests targeting `main`. It deploys to an environment named like
97
- `preview-pr-<number>` and exposes the preview URL on the GitHub Actions run.
98
- - **Production** — runs on pushes to `main`. It deploys with the default production environment.
99
-
100
- If the file already exists, pass `--force` to overwrite it.
101
-
102
- ### 2. Add your deployment token as a GitHub secret
103
-
104
- 1. In [APIToGo](https://apitogo.com), open your project and copy the **deployment token** from
105
- project settings (the same token you use with `apitogo deploy`).
106
- 2. On GitHub, open your repository → **Settings** → **Secrets and variables** → **Actions**.
107
- 3. Create a new repository secret named **`APITOGO_TOKEN`** and paste the token.
108
-
109
- The generated workflow reads that secret as `${{ secrets.APITOGO_TOKEN }}`.
110
-
111
- ### 3. Optional: GitHub environments
112
-
113
- The workflow references **`preview`** and **`production`**
114
- [environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment).
115
- If you use environment protection rules, create matching environments in the repo settings and
116
- attach reviewers or branch filters as needed. If you do not use environments, the jobs still run;
117
- you can simplify the workflow later to drop `environment:` blocks.
118
-
119
- ### 4. Commit and ship
120
-
121
- Add the new workflow to version control, commit, and push:
122
-
123
- ```bash
124
- git add .github/workflows/apitogo-deploy.yml
125
- git commit -m "Add APIToGo GitHub Actions deploy workflow"
126
- git push
127
- ```
128
-
129
- After that, pushes and pull requests against `main` trigger deploys automatically. You can also run
130
- the workflow manually from the **Actions** tab (**workflow_dispatch**).
131
-
132
- ## What to verify after deployment
133
-
134
- After your site is live, check the following:
135
-
136
- - Navigation load correctly
137
- - Static assets such as images and logos resolve correctly
138
- - OpenAPI references and API playground features load as expected
139
- - Any custom domain or redirects are working properly
140
-
141
- ## Open APIToGo
142
-
143
- To get started, sign in here:
144
-
145
- - [APIToGo Dashboard](https://apitogo.com)
@@ -1,22 +1,8 @@
1
- ---
2
- title: Deploying APIToGo
3
- ---
1
+ # Deployment
4
2
 
5
- Choose how you publish:
3
+ | Path | Docs |
4
+ | --- | --- |
5
+ | **CLI** (`apitogo apply`) | [Go live with CLI](./cli/go-live.md) |
6
+ | **MCP / agents** | [Go live](./mcp/go-live.md) |
6
7
 
7
- | Path | Guide |
8
- | ---- | ----- |
9
- | **MCP go-live** (portal + plans + hosting) | [MCP go-live](./mcp/go-live.md) |
10
- | **CLI** (`apitogo deploy` + token) | [Deploy with APIToGo CLI](./deploy/apitogo.md) |
11
- | **Static host** (GitHub Pages, upload `dist`) | Below and sibling deploy guides |
12
-
13
- ## Build locally
14
-
15
- Produce static HTML, JavaScript, and CSS for any host:
16
-
17
- ```bash
18
- npm run build
19
- ```
20
-
21
- Output is in `dist/`. Upload that folder, or use [direct upload](./deploy/direct-upload.md) /
22
- [GitHub Pages](./deploy/github-pages.md).
8
+ Local-only builds: `apitogo build` (optional `--preview`). Platform publish is always `apitogo apply`.
@@ -11,6 +11,14 @@ components that APIToGo already has such as buttons, links and headers.
11
11
 
12
12
  Start by creating the page you want to add.
13
13
 
14
+ ## CLI scaffold
15
+
16
+ `apitogo config -i` can create a starter page under `pages/` and wire it into navigation. Choose
17
+ `page` in the wizard loop, then edit the generated `.tsx` file.
18
+
19
+ Predefined UI components (Callout, Card, Button, Heading, and more) are documented under
20
+ [/docs/components/](/docs/components/callout).
21
+
14
22
  ## Setup a custom page
15
23
 
16
24
  Each custom page is a page component of its own and lives in a `src` directory at the root of your
@@ -21,7 +21,7 @@ APIToGo uses Vite’s [env and mode](https://vite.dev/guide/env-and-mode) model,
21
21
  Nested overrides use `__` path segments (SCREAMING_SNAKE). See [Manifest](../configuration/manifest.md).
22
22
 
23
23
  **Never commit** OIDC client secrets or Stripe keys. MCP never puts secrets in chat — you write them
24
- to `.env` before [go-live](../mcp/go-live.md).
24
+ to `.env` before [go-live](../mcp/go-live.md) or `apitogo apply` ([CLI go-live](../cli/go-live.md)).
25
25
 
26
26
  Example:
27
27
 
@@ -85,7 +85,8 @@ interface ImportMeta {
85
85
 
86
86
  | Variable | Purpose |
87
87
  | -------- | ------- |
88
- | `APITOGO_API_KEY_ID` / `APITOGO_API_SECRET` | Required for MCP |
88
+ | `APITOGO_API_KEY_ID` / `APITOGO_API_SECRET` | Required for MCP and CLI apply/status/teardown |
89
89
  | `APITOGO_DOC_TOOL_PATH` | Optional local doc-tool for scaffold |
90
+ | `APITOGO_MCP_PATH` | Optional local MCP checkout for CLI apply/status/teardown |
90
91
 
91
- See [MCP overview](../mcp/overview.md).
92
+ See [MCP overview](../mcp/overview.md) and [CLI overview](../cli/overview.md).
@@ -88,9 +88,9 @@ shape → deploy_backend → publish_dev_portal(skipBackendRedeploy: true)
88
88
  | Path | Use when |
89
89
  | ---------------------------- | ----------------------------------------------------- |
90
90
  | MCP `publish_dev_portal` | Full product go-live (plans, auth, hosting, verify) |
91
- | CLI `apitogo deploy` | Build + deploy a site with a deployment token only |
91
+ | CLI `apitogo apply` | Publish config to platform (apihub + portal) |
92
92
 
93
- See [Deploy with APIToGo CLI](../deploy/apitogo.md).
93
+ See [Go live with CLI](../cli/go-live.md).
94
94
 
95
95
  ## Related
96
96
 
@@ -73,4 +73,4 @@ Details: [Manifest](../configuration/manifest.md).
73
73
  - [Configure MCP](./setup.md)
74
74
  - [Quickstart](../quickstart.md)
75
75
  - [Shape](./shape.md) · [Go live](./go-live.md) · [Tools](./tools.md)
76
- - CLI without an agent: see the footnote on [Quickstart](../quickstart.md#without-an-agent-cli)
76
+ - CLI without an agent: [CLI overview](../cli/overview.md)
@@ -68,14 +68,6 @@ Build an API product (developer portal, plans, gateway, backend) with an AI agen
68
68
 
69
69
  ## Without an agent (CLI)
70
70
 
71
- If you prefer not to use MCP:
71
+ Prefer the terminal? Use the **`apitogo`** CLI for the same config-first workflow:
72
72
 
73
- ```bash
74
- npm create @lukoweb/apitogo@latest
75
- cd your-project-name
76
- npm run dev
77
- ```
78
-
79
- For an existing `pages/` + OpenAPI folder: `apitogo make-config` (see
80
- [Make config](./configuration/make-config.mdx)). That command writes `apitogo.config.json`. Site-only
81
- deploy with a token: [Deploy with APIToGo CLI](./deploy/apitogo.md).
73
+ → **[Install the CLI](./cli/setup.md)** · [Shape](./cli/shape.md) · [Go live](./cli/go-live.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.77",
3
+ "version": "0.1.79",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",