@lukoweb/apitogo 0.2.46 → 0.2.49
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/dist/cli/cli.js +1176 -3106
- package/docs/cli/overview.md +91 -91
- package/docs/cli/shape.md +127 -127
- package/docs/cli/walkthrough.md +14 -25
- package/docs/configuration/make-config.mdx +97 -124
- package/docs/configuration/manifest.md +129 -128
- package/docs/configuration/navigation.mdx +415 -421
- package/docs/configuration/plans.md +154 -153
- package/docs/guides/custom-pages.md +111 -110
- package/package.json +1 -1
- package/src/config/v2/__fixtures__/scenario-a-docs-only.json +6 -6
- package/src/config/v2/__fixtures__/scenario-b-managed-origin.json +14 -14
- package/src/config/v2/__fixtures__/scenario-c-proxy-oidc.json +15 -15
- package/src/config/v2/__fixtures__/scenario-h-full-stack.json +28 -28
- package/src/config/v2/billing.ts +59 -0
- package/src/config/v2/docs-navigation.ts +72 -72
- package/src/config/v2/errors.ts +42 -42
- package/src/config/v2/gateway-reference.ts +220 -220
- package/src/config/v2/gateway-request.ts +123 -123
- package/src/config/v2/index.ts +7 -0
- package/src/config/v2/layout.ts +237 -237
- package/src/config/v2/load.ts +70 -70
- package/src/config/v2/parse.ts +214 -214
- package/src/config/v2/portal-profile.ts +88 -88
- package/src/config/v2/resolve.ts +6 -1
- package/src/config/v2/rules.ts +27 -15
- package/src/config/v2/services.ts +6 -21
package/docs/cli/overview.md
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: CLI overview
|
|
3
|
-
description:
|
|
4
|
-
Use the APItoGo CLI to scaffold, shape, preview, and publish API products without an AI agent.
|
|
5
|
-
sidebar_icon: terminal
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
The **`apitogo`** CLI lets you manage developer portals from the terminal. You scaffold and shape
|
|
9
|
-
local files, preview with `npx apitogo run`, and publish to APItoGo hosting with
|
|
10
|
-
`npx apitogo deploy`.
|
|
11
|
-
|
|
12
|
-
**First time?** Install and wire credentials → **[Install the CLI](./setup.md)**. Then follow
|
|
13
|
-
[Shape](./shape.md) and [Go live](./go-live.md).
|
|
14
|
-
|
|
15
|
-
## What you get
|
|
16
|
-
|
|
17
|
-
- Scaffold a local portal site (`npx @lukoweb/apitogo@latest init`)
|
|
18
|
-
- Shape backend, OpenAPI, plans, and docs pages via `npx apitogo config` and file edits
|
|
19
|
-
- Preview locally (`npx apitogo run`)
|
|
20
|
-
- Publish to APItoGo hosting (`npx apitogo deploy`) with platform plans **Free**, **Starter**, or
|
|
21
|
-
**Professional**
|
|
22
|
-
- Check live status (`npx apitogo status`) and tear down (`npx apitogo teardown --yes`)
|
|
23
|
-
|
|
24
|
-
## Prerequisites
|
|
25
|
-
|
|
26
|
-
### Shell environment (for deploy / status / teardown)
|
|
27
|
-
|
|
28
|
-
| Variable | Required | Purpose |
|
|
29
|
-
| -------------------- | -------- | ----------------- |
|
|
30
|
-
| `APITOGO_API_KEY_ID` | Yes | Platform API auth |
|
|
31
|
-
| `APITOGO_API_SECRET` | Yes | Platform API auth |
|
|
32
|
-
|
|
33
|
-
### Local machine
|
|
34
|
-
|
|
35
|
-
- Node.js 20+ (scaffold, build, preview)
|
|
36
|
-
- Network access to the npm registry during install/build
|
|
37
|
-
- OIDC credentials at publish time (site `.env` only — never in shell history for sharing)
|
|
38
|
-
- Stripe secrets at publish only when you have **paid** project plans
|
|
39
|
-
|
|
40
|
-
## Changing your site
|
|
41
|
-
|
|
42
|
-
| Approach | When it helps |
|
|
43
|
-
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
-
| **`npx apitogo config`** | Wire OpenAPI, custom pages, gateway plans, and site title from the terminal. See [Make config](../configuration/make-config.mdx). |
|
|
45
|
-
| **Edit files directly** | Full control — `apitogo.config.json`, `pages/**`, `landing/LandingPage.tsx`, etc. |
|
|
46
|
-
|
|
47
|
-
Common CLI shape tasks:
|
|
48
|
-
|
|
49
|
-
| Change | How
|
|
50
|
-
| --------------------------------- |
|
|
51
|
-
| Backend runtime | `npx apitogo config` (backend)
|
|
52
|
-
| OpenAPI
|
|
53
|
-
| Custom docs pages | `npx apitogo config` (page) or add under `pages/` |
|
|
54
|
-
| Gateway / API plans | `npx apitogo config` (plan) or edit
|
|
55
|
-
| Site title | `--title` or edit `apitogo.config.json`
|
|
56
|
-
| Theme, fonts, branding, projectId | Edit `apitogo.config.json`
|
|
57
|
-
|
|
58
|
-
Home page content often lives in `landing/LandingPage.tsx`. Site footer can live under
|
|
59
|
-
`modules.landing.content.footer` in `apitogo.config.json`.
|
|
60
|
-
|
|
61
|
-
## Config model (local site)
|
|
62
|
-
|
|
63
|
-
| File | Role |
|
|
64
|
-
| --------------------- | ------------------------------------- |
|
|
65
|
-
| `apitogo.config.json` | Site, modules, plans, auth type, apis |
|
|
66
|
-
| `.env` | `VITE_*` + `APITOGO_CONFIG_*` secrets |
|
|
67
|
-
|
|
68
|
-
Details: [Manifest](../configuration/manifest.md).
|
|
69
|
-
|
|
70
|
-
## CLI vs MCP
|
|
71
|
-
|
|
72
|
-
Both paths use the same config-first model. `npx apitogo deploy` runs the same engine as MCP
|
|
73
|
-
`publish_dev_portal`.
|
|
74
|
-
|
|
75
|
-
| Task | CLI | MCP (agent) |
|
|
76
|
-
| ----------------- | --------------------------------------------- | --------------------------------------------- |
|
|
77
|
-
| Scaffold | `npx @lukoweb/apitogo@latest init` | `create_dev_portal` |
|
|
78
|
-
| Shape config | `npx apitogo config` + file edits | `apply_product_intent` (shape) |
|
|
79
|
-
| Preview | `npx apitogo run` | `npm run dev` / preview tool |
|
|
80
|
-
| Publish | `npx apitogo deploy` | `publish_dev_portal` |
|
|
81
|
-
| Status / teardown | `npx apitogo status` / `npx apitogo teardown` | `verify_dev_portal_live` / `teardown_project` |
|
|
82
|
-
|
|
83
|
-
Prefer MCP when an agent should drive changes. Prefer CLI for CI, scripts, or terminal-only
|
|
84
|
-
workflows.
|
|
85
|
-
|
|
86
|
-
## Next
|
|
87
|
-
|
|
88
|
-
- [Install the CLI](./setup.md)
|
|
89
|
-
- [Shape](./shape.md) · [Go live](./go-live.md) · [Commands](./commands.md)
|
|
90
|
-
- [MCP overview](../mcp/overview.md) — agent-driven workflow
|
|
91
|
-
- [Manifest](../configuration/manifest.md)
|
|
1
|
+
---
|
|
2
|
+
title: CLI overview
|
|
3
|
+
description:
|
|
4
|
+
Use the APItoGo CLI to scaffold, shape, preview, and publish API products without an AI agent.
|
|
5
|
+
sidebar_icon: terminal
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
The **`apitogo`** CLI lets you manage developer portals from the terminal. You scaffold and shape
|
|
9
|
+
local files, preview with `npx apitogo run`, and publish to APItoGo hosting with
|
|
10
|
+
`npx apitogo deploy`.
|
|
11
|
+
|
|
12
|
+
**First time?** Install and wire credentials → **[Install the CLI](./setup.md)**. Then follow
|
|
13
|
+
[Shape](./shape.md) and [Go live](./go-live.md).
|
|
14
|
+
|
|
15
|
+
## What you get
|
|
16
|
+
|
|
17
|
+
- Scaffold a local portal site (`npx @lukoweb/apitogo@latest init`)
|
|
18
|
+
- Shape backend, OpenAPI, plans, and docs pages via `npx apitogo config` and file edits
|
|
19
|
+
- Preview locally (`npx apitogo run`)
|
|
20
|
+
- Publish to APItoGo hosting (`npx apitogo deploy`) with platform plans **Free**, **Starter**, or
|
|
21
|
+
**Professional**
|
|
22
|
+
- Check live status (`npx apitogo status`) and tear down (`npx apitogo teardown --yes`)
|
|
23
|
+
|
|
24
|
+
## Prerequisites
|
|
25
|
+
|
|
26
|
+
### Shell environment (for deploy / status / teardown)
|
|
27
|
+
|
|
28
|
+
| Variable | Required | Purpose |
|
|
29
|
+
| -------------------- | -------- | ----------------- |
|
|
30
|
+
| `APITOGO_API_KEY_ID` | Yes | Platform API auth |
|
|
31
|
+
| `APITOGO_API_SECRET` | Yes | Platform API auth |
|
|
32
|
+
|
|
33
|
+
### Local machine
|
|
34
|
+
|
|
35
|
+
- Node.js 20+ (scaffold, build, preview)
|
|
36
|
+
- Network access to the npm registry during install/build
|
|
37
|
+
- OIDC credentials at publish time (site `.env` only — never in shell history for sharing)
|
|
38
|
+
- Stripe secrets at publish only when you have **paid** project plans
|
|
39
|
+
|
|
40
|
+
## Changing your site
|
|
41
|
+
|
|
42
|
+
| Approach | When it helps |
|
|
43
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
44
|
+
| **`npx apitogo config`** | Wire OpenAPI, custom pages, gateway plans, and site title from the terminal. See [Make config](../configuration/make-config.mdx). |
|
|
45
|
+
| **Edit files directly** | Full control — `apitogo.config.json`, `pages/**`, `landing/LandingPage.tsx`, etc. |
|
|
46
|
+
|
|
47
|
+
Common CLI shape tasks:
|
|
48
|
+
|
|
49
|
+
| Change | How |
|
|
50
|
+
| --------------------------------- | ---------------------------------------------------------------- |
|
|
51
|
+
| Backend runtime | `npx apitogo config` (backend) |
|
|
52
|
+
| OpenAPI files (`gateway.specs`) | `npx apitogo config` (openapi) |
|
|
53
|
+
| Custom docs pages | `npx apitogo config` (page) or add under `apitogo/portal/pages/` |
|
|
54
|
+
| Gateway / API plans | `npx apitogo config` (plan) or edit `apitogo/plans.json` |
|
|
55
|
+
| Site title | `--title` or edit `apitogo.config.json` |
|
|
56
|
+
| Theme, fonts, branding, projectId | Edit `apitogo.config.json` |
|
|
57
|
+
|
|
58
|
+
Home page content often lives in `landing/LandingPage.tsx`. Site footer can live under
|
|
59
|
+
`modules.landing.content.footer` in `apitogo.config.json`.
|
|
60
|
+
|
|
61
|
+
## Config model (local site)
|
|
62
|
+
|
|
63
|
+
| File | Role |
|
|
64
|
+
| --------------------- | ------------------------------------- |
|
|
65
|
+
| `apitogo.config.json` | Site, modules, plans, auth type, apis |
|
|
66
|
+
| `.env` | `VITE_*` + `APITOGO_CONFIG_*` secrets |
|
|
67
|
+
|
|
68
|
+
Details: [Manifest](../configuration/manifest.md).
|
|
69
|
+
|
|
70
|
+
## CLI vs MCP
|
|
71
|
+
|
|
72
|
+
Both paths use the same config-first model. `npx apitogo deploy` runs the same engine as MCP
|
|
73
|
+
`publish_dev_portal`.
|
|
74
|
+
|
|
75
|
+
| Task | CLI | MCP (agent) |
|
|
76
|
+
| ----------------- | --------------------------------------------- | --------------------------------------------- |
|
|
77
|
+
| Scaffold | `npx @lukoweb/apitogo@latest init` | `create_dev_portal` |
|
|
78
|
+
| Shape config | `npx apitogo config` + file edits | `apply_product_intent` (shape) |
|
|
79
|
+
| Preview | `npx apitogo run` | `npm run dev` / preview tool |
|
|
80
|
+
| Publish | `npx apitogo deploy` | `publish_dev_portal` |
|
|
81
|
+
| Status / teardown | `npx apitogo status` / `npx apitogo teardown` | `verify_dev_portal_live` / `teardown_project` |
|
|
82
|
+
|
|
83
|
+
Prefer MCP when an agent should drive changes. Prefer CLI for CI, scripts, or terminal-only
|
|
84
|
+
workflows.
|
|
85
|
+
|
|
86
|
+
## Next
|
|
87
|
+
|
|
88
|
+
- [Install the CLI](./setup.md)
|
|
89
|
+
- [Shape](./shape.md) · [Go live](./go-live.md) · [Commands](./commands.md)
|
|
90
|
+
- [MCP overview](../mcp/overview.md) — agent-driven workflow
|
|
91
|
+
- [Manifest](../configuration/manifest.md)
|
package/docs/cli/shape.md
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Shape with CLI
|
|
3
|
-
description:
|
|
4
|
-
Scaffold and customize a developer portal locally with npx apitogo init, config, and run.
|
|
5
|
-
sidebar_icon: pencil-ruler
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
**Shape** means: create or update a local portal site (OpenAPI, plans, docs pages, auth) without
|
|
9
|
-
publishing. You preview with `npx apitogo run`.
|
|
10
|
-
|
|
11
|
-
Requires the **`apitogo`** CLI (`@lukoweb/apitogo`). If you have not installed it yet, see
|
|
12
|
-
[Install the CLI](./setup.md).
|
|
13
|
-
|
|
14
|
-
## Happy path
|
|
15
|
-
|
|
16
|
-
`npx @lukoweb/apitogo@latest init` scaffolds into `./dev-portal` by default (pass a folder name or
|
|
17
|
-
`--name` to override), installs dependencies, and wires nearby OpenAPI / docs. Then run config via
|
|
18
|
-
`npx`:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npx @lukoweb/apitogo@latest init
|
|
22
|
-
cd dev-portal
|
|
23
|
-
npx apitogo config # backend, OpenAPI, pages, plans (apply each immediately)
|
|
24
|
-
npx apitogo run # http://localhost:3000
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Named folder:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npx @lukoweb/apitogo@latest init ./my-portal --name "Books API"
|
|
31
|
-
cd ./my-portal
|
|
32
|
-
npx apitogo config
|
|
33
|
-
npx apitogo run
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`npx @lukoweb/apitogo init` does **not** call the platform. Run `npx apitogo deploy` when you are
|
|
37
|
-
ready to go live.
|
|
38
|
-
|
|
39
|
-
## Interactive config (`npx apitogo config`)
|
|
40
|
-
|
|
41
|
-
On a TTY, bare `npx apitogo config` opens the wizard. Each choice is written immediately; the loop
|
|
42
|
-
continues until you type `done`:
|
|
43
|
-
|
|
44
|
-
| Choice | What it does
|
|
45
|
-
| --------- |
|
|
46
|
-
| `backend` | Set `
|
|
47
|
-
| `openapi` |
|
|
48
|
-
| `page` | Create `pages/<slug>.
|
|
49
|
-
| `plan` | Add a
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
npx apitogo config
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
| `--
|
|
81
|
-
| `--title`
|
|
82
|
-
| `--
|
|
83
|
-
| `--
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- **Plans
|
|
91
|
-
- **Docs pages** — `pages/**/*.mdx`
|
|
92
|
-
- **Home page** — `landing
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
Never put OIDC or Stripe secrets in `apitogo.config.json`. Use `.env` with
|
|
96
|
-
`APITOGO_CONFIG_AUTHENTICATION__*` before publish.
|
|
97
|
-
|
|
98
|
-
## Preview locally
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
npx apitogo run
|
|
102
|
-
npx apitogo run --port 4000 --open
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Production build check:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
npx apitogo build
|
|
109
|
-
npx apitogo build --preview
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Shape-phase edits hot-reload when the dev server is running.
|
|
113
|
-
|
|
114
|
-
## Existing docs + OpenAPI folder
|
|
115
|
-
|
|
116
|
-
If you already have `pages/` and an OpenAPI spec:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
npx @lukoweb/apitogo@latest init
|
|
120
|
-
cd dev-portal
|
|
121
|
-
npx apitogo config
|
|
122
|
-
npx apitogo run
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Next
|
|
126
|
-
|
|
127
|
-
When the site looks right, [go live](./go-live.md) with `npx apitogo deploy`.
|
|
1
|
+
---
|
|
2
|
+
title: Shape with CLI
|
|
3
|
+
description:
|
|
4
|
+
Scaffold and customize a developer portal locally with npx apitogo init, config, and run.
|
|
5
|
+
sidebar_icon: pencil-ruler
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
**Shape** means: create or update a local portal site (OpenAPI, plans, docs pages, auth) without
|
|
9
|
+
publishing. You preview with `npx apitogo run`.
|
|
10
|
+
|
|
11
|
+
Requires the **`apitogo`** CLI (`@lukoweb/apitogo`). If you have not installed it yet, see
|
|
12
|
+
[Install the CLI](./setup.md).
|
|
13
|
+
|
|
14
|
+
## Happy path
|
|
15
|
+
|
|
16
|
+
`npx @lukoweb/apitogo@latest init` scaffolds into `./dev-portal` by default (pass a folder name or
|
|
17
|
+
`--name` to override), installs dependencies, and wires nearby OpenAPI / docs. Then run config via
|
|
18
|
+
`npx`:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @lukoweb/apitogo@latest init
|
|
22
|
+
cd dev-portal
|
|
23
|
+
npx apitogo config # backend, OpenAPI, pages, plans (apply each immediately)
|
|
24
|
+
npx apitogo run # http://localhost:3000
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Named folder:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @lukoweb/apitogo@latest init ./my-portal --name "Books API"
|
|
31
|
+
cd ./my-portal
|
|
32
|
+
npx apitogo config
|
|
33
|
+
npx apitogo run
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`npx @lukoweb/apitogo init` does **not** call the platform. Run `npx apitogo deploy` when you are
|
|
37
|
+
ready to go live.
|
|
38
|
+
|
|
39
|
+
## Interactive config (`npx apitogo config`)
|
|
40
|
+
|
|
41
|
+
On a TTY, bare `npx apitogo config` opens the wizard. Each choice is written immediately; the loop
|
|
42
|
+
continues until you type `done`:
|
|
43
|
+
|
|
44
|
+
| Choice | What it does |
|
|
45
|
+
| --------- | ------------------------------------------------------------------------ |
|
|
46
|
+
| `backend` | Set `gateway.origin`: API code folder, runtime and runtime version |
|
|
47
|
+
| `openapi` | Add an OpenAPI file to `gateway.specs` |
|
|
48
|
+
| `page` | Create `apitogo/portal/pages/<slug>.mdx` (the sidebar follows the files) |
|
|
49
|
+
| `plan` | Add a plan to `apitogo/plans.json` (title, price, rate limit, quota) |
|
|
50
|
+
|
|
51
|
+
Fonts and colors are **not** prompted. See [Colors & theme](../customization/colors-theme.mdx).
|
|
52
|
+
|
|
53
|
+
**Paid plans:** payments go through Stripe. Once a plan has a price, `npx apitogo deploy` asks for
|
|
54
|
+
your Stripe secret key (if the project has none yet) and stores it as a project secret. Free and
|
|
55
|
+
contact-us plans need no key. Paid plans also need **Starter** or **Professional** platform hosting;
|
|
56
|
+
**Free** cannot publish paid gateway plans or custom domains.
|
|
57
|
+
|
|
58
|
+
Full reference: [Make config (CLI)](../configuration/make-config.mdx) ·
|
|
59
|
+
[Gateway plans](../configuration/plans.md)
|
|
60
|
+
|
|
61
|
+
## Configure with flags
|
|
62
|
+
|
|
63
|
+
Changes a config version 2 project. Every change to `apitogo.config.json` is checked before it is
|
|
64
|
+
written. The command does not create a project: use `init` or `create` for that.
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx apitogo config --title "Books API"
|
|
68
|
+
npx apitogo config --page-slug guides/quickstart --page-title "Quickstart"
|
|
69
|
+
npx apitogo config --plan '{"sku":"free","displayName":"Free"}'
|
|
70
|
+
npx apitogo config --no-interactive
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Common flags:
|
|
74
|
+
|
|
75
|
+
| Flag | Purpose |
|
|
76
|
+
| -------------------------------------------- | ---------------------------------------------------------- |
|
|
77
|
+
| `--interactive` / `-i` | Force wizard (default on TTY). `--no-interactive` skips it |
|
|
78
|
+
| `--title` | Set `portal.name` |
|
|
79
|
+
| `--source`, `--runtime`, `--runtime-version` | Set `gateway.origin` |
|
|
80
|
+
| `--openapi` | Add a file to `gateway.specs` |
|
|
81
|
+
| `--page-slug`, `--page-title` | Add a docs page |
|
|
82
|
+
| `--plan` | Add or replace a plan in `plans.json` |
|
|
83
|
+
| `--patch` | Deep-merge JSON into `apitogo.config.json` |
|
|
84
|
+
|
|
85
|
+
## Shape by editing files
|
|
86
|
+
|
|
87
|
+
After `npx apitogo config`, edit the manifest and site files directly:
|
|
88
|
+
|
|
89
|
+
- **Services, backend, OpenAPI files** — `apitogo.config.json`
|
|
90
|
+
- **Plans** — `apitogo/plans.json`
|
|
91
|
+
- **Docs pages** — `apitogo/portal/pages/**/*.mdx`
|
|
92
|
+
- **Home page** — the file in `portal.landing` (for example
|
|
93
|
+
`apitogo/portal/landing/LandingPage.tsx`)
|
|
94
|
+
|
|
95
|
+
Never put OIDC or Stripe secrets in `apitogo.config.json`. Use `.env` with
|
|
96
|
+
`APITOGO_CONFIG_AUTHENTICATION__*` before publish.
|
|
97
|
+
|
|
98
|
+
## Preview locally
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx apitogo run
|
|
102
|
+
npx apitogo run --port 4000 --open
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Production build check:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx apitogo build
|
|
109
|
+
npx apitogo build --preview
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Shape-phase edits hot-reload when the dev server is running.
|
|
113
|
+
|
|
114
|
+
## Existing docs + OpenAPI folder
|
|
115
|
+
|
|
116
|
+
If you already have `pages/` and an OpenAPI spec:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npx @lukoweb/apitogo@latest init
|
|
120
|
+
cd dev-portal
|
|
121
|
+
npx apitogo config
|
|
122
|
+
npx apitogo run
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Next
|
|
126
|
+
|
|
127
|
+
When the site looks right, [go live](./go-live.md) with `npx apitogo deploy`.
|
package/docs/cli/walkthrough.md
CHANGED
|
@@ -37,7 +37,7 @@ below use the installed CLI through `npx apitogo`.
|
|
|
37
37
|
```bash
|
|
38
38
|
npx apitogo add identity
|
|
39
39
|
npx apitogo add gateway --origin proxy --url https://httpbin.org --auth identity --create-spec
|
|
40
|
-
npx apitogo add plans --template free
|
|
40
|
+
npx apitogo add plans --template free
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
| Service | What it gives you |
|
|
@@ -117,32 +117,21 @@ Professional plan with APItoGo, and your own Stripe account. Your customers pay
|
|
|
117
117
|
opens the platform's checkout for the hosting fee. A project that already exists on the Free plan
|
|
118
118
|
cannot be moved: create a new one. See
|
|
119
119
|
[Selling paid plans needs Starter or Professional](./commands.md#selling-paid-plans-needs-starter-or-professional).
|
|
120
|
-
2.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
```json
|
|
130
|
-
"plans": {
|
|
131
|
-
"billing": { "provider": "stripe", "apiKey": "secret:STRIPE_KEY" }
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
4. Give a plan a price in `plans.json`: `"priceAmount": 49`, `"priceCurrency": "usd"` and
|
|
136
|
-
`"billingPeriod": "month"`. Its limits cannot be higher than your platform plan allows. A plan
|
|
137
|
-
with a price is refused while billing is off, so nobody is offered a plan they cannot pay for.
|
|
138
|
-
5. Deploy: `npx apitogo deploy`. The output says whether Stripe is in test or live mode and prints
|
|
139
|
-
your portal's webhook address.
|
|
140
|
-
6. In Stripe, add that address as a webhook endpoint with the events `checkout.session.completed`,
|
|
120
|
+
2. Give a plan a price in `plans.json`: `"priceAmount": 49`, `"priceCurrency": "usd"` and
|
|
121
|
+
`"billingInterval": "month"`. Its limits cannot be higher than your platform plan allows.
|
|
122
|
+
Payments go through Stripe; nothing else in the config changes.
|
|
123
|
+
3. Deploy: `npx apitogo deploy`. Because a plan now has a price, deploy asks for your Stripe secret
|
|
124
|
+
key (it starts with `sk_test_` while you test) and stores it as the project secret
|
|
125
|
+
`STRIPE_API_KEY`, so it stays out of your files. You can also store it beforehand with
|
|
126
|
+
`npx apitogo secrets set STRIPE_API_KEY`. The output says whether Stripe is in test or live mode
|
|
127
|
+
and prints your portal's webhook address.
|
|
128
|
+
4. In Stripe, add that address as a webhook endpoint with the events `checkout.session.completed`,
|
|
141
129
|
`customer.subscription.updated`, `customer.subscription.deleted` and `invoice.payment_failed`.
|
|
142
130
|
Copy the signing secret (it starts with `whsec_`), store it with
|
|
143
|
-
`npx apitogo secrets set STRIPE_WEBHOOK`, add
|
|
144
|
-
`
|
|
145
|
-
|
|
131
|
+
`npx apitogo secrets set STRIPE_WEBHOOK`, add
|
|
132
|
+
`"plans": { "billing": { "webhookSecret": "secret:STRIPE_WEBHOOK" } }` to `apitogo.config.json`,
|
|
133
|
+
and deploy again. Until then a payment does not activate the plan, because the portal cannot
|
|
134
|
+
confirm it came from Stripe.
|
|
146
135
|
|
|
147
136
|
While you use a test key, pay with [Stripe's test cards](https://docs.stripe.com/testing). No real
|
|
148
137
|
money moves. Never type a live key until you have tested the whole path.
|