@lukoweb/apitogo 0.2.54 → 0.2.57

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.
Files changed (82) hide show
  1. package/dist/cli/cli.js +2196 -1352
  2. package/dist/declarations/cli/platform/client/platform-api.d.ts +29 -0
  3. package/dist/declarations/cli/platform/helpers/platform-plan-catalog.d.ts +6 -0
  4. package/dist/declarations/config/validators/ZudokuConfig.d.ts +2 -0
  5. package/dist/declarations/lib/authentication/providers/openid.d.ts +2 -1
  6. package/dist/declarations/lib/plugins/markdown/index.d.ts +2 -1
  7. package/dist/flat-config.d.ts +1 -0
  8. package/docs/cli/commands.md +50 -32
  9. package/docs/cli/go-live.md +66 -93
  10. package/docs/cli/overview.md +18 -17
  11. package/docs/cli/setup.md +130 -141
  12. package/docs/cli/shape.md +94 -11
  13. package/docs/cli/walkthrough.md +1 -1
  14. package/docs/components/slot.mdx +116 -119
  15. package/docs/configuration/api-reference.md +98 -397
  16. package/docs/configuration/authentication.md +118 -159
  17. package/docs/configuration/footer.mdx +89 -118
  18. package/docs/configuration/make-config.mdx +2 -2
  19. package/docs/configuration/overview.md +97 -166
  20. package/docs/configuration/plans.md +100 -110
  21. package/docs/configuration/portal.md +116 -0
  22. package/docs/customization/colors-theme.mdx +255 -278
  23. package/docs/customization/fonts.md +105 -110
  24. package/docs/customization/landing-page.md +189 -188
  25. package/docs/deploy/apitogo.md +13 -17
  26. package/docs/deployment.md +15 -9
  27. package/docs/guides/stripe-setup.mdx +123 -0
  28. package/docs/markdown/frontmatter.md +172 -173
  29. package/docs/mcp/go-live.md +100 -100
  30. package/docs/mcp/overview.md +76 -76
  31. package/docs/quickstart.md +88 -72
  32. package/docs/writing.mdx +68 -72
  33. package/package.json +1 -1
  34. package/src/config/v2/docs-navigation.ts +7 -2
  35. package/src/config/v2/index.ts +1 -0
  36. package/src/config/v2/resolve.ts +28 -0
  37. package/src/config/v2/rules.ts +32 -1
  38. package/src/config/v2/schema.ts +9 -0
  39. package/src/config/v2/services.ts +90 -15
  40. package/src/config/v2/starter-landing.ts +41 -0
  41. package/src/config/v2/wrapper.ts +141 -7
  42. package/src/config/validators/ZudokuConfig.ts +794 -792
  43. package/src/lib/authentication/providers/openid.tsx +6 -1
  44. package/src/lib/plugins/markdown/index.tsx +86 -82
  45. package/src/vite/dev-server.ts +9 -1
  46. package/src/vite/dev-ssr-config.ts +32 -0
  47. package/src/vite/plugin-config.ts +4 -2
  48. package/src/vite/plugin-docs.ts +213 -205
  49. package/docs/concepts/auth-provider-api-identities.md +0 -105
  50. package/docs/configuration/ai-assistants.md +0 -65
  51. package/docs/configuration/api-catalog.md +0 -109
  52. package/docs/configuration/authentication-auth0.md +0 -181
  53. package/docs/configuration/authentication-azure-ad.md +0 -245
  54. package/docs/configuration/authentication-clerk.md +0 -117
  55. package/docs/configuration/authentication-firebase.md +0 -69
  56. package/docs/configuration/authentication-pingfederate.md +0 -143
  57. package/docs/configuration/authentication-supabase.md +0 -233
  58. package/docs/configuration/build-configuration.mdx +0 -147
  59. package/docs/configuration/docs.md +0 -282
  60. package/docs/configuration/llms.md +0 -90
  61. package/docs/configuration/manifest.md +0 -129
  62. package/docs/configuration/navigation.mdx +0 -415
  63. package/docs/configuration/protected-routes.md +0 -150
  64. package/docs/configuration/search.md +0 -164
  65. package/docs/configuration/sentry.mdx +0 -44
  66. package/docs/configuration/site.md +0 -124
  67. package/docs/configuration/slots.mdx +0 -125
  68. package/docs/configuration/vite-config.md +0 -18
  69. package/docs/custom-plugins.md +0 -285
  70. package/docs/deploy/apache-nginx.md +0 -41
  71. package/docs/deploy/cloudflare-pages.md +0 -74
  72. package/docs/deploy/direct-upload.md +0 -17
  73. package/docs/deploy/github-pages.md +0 -49
  74. package/docs/deploy/vercel.md +0 -101
  75. package/docs/extending/events.md +0 -124
  76. package/docs/guides/environment-variables.md +0 -94
  77. package/docs/guides/managing-api-keys-and-identities.md +0 -89
  78. package/docs/guides/navigation-rules.mdx +0 -203
  79. package/docs/guides/processors.mdx +0 -234
  80. package/docs/guides/transforming-examples.md +0 -156
  81. package/docs/guides/using-multiple-apis.md +0 -87
  82. package/docs/plugins.md +0 -24
@@ -1,166 +1,97 @@
1
- ---
2
- title: Configuration overview
3
- sidebar_icon: file-json-2
4
- description: How APIToGo sites are configured — apitogo.config.json and .env overrides.
5
- ---
6
-
7
- APIToGo sites are configured primarily with JSON and environment variables:
8
-
9
- | File | Role |
10
- | --------------------- | --------------------------------------------------------------------- |
11
- | `apitogo.config.json` | Committed site defaults: site, modules, auth, apis, navigation, theme |
12
- | `.env` | Client URLs and publish secrets (`APITOGO_CONFIG_*`, `VITE_*`) |
13
-
14
- For portal fields (plans, auth, backend metadata), see
15
- **[Site configuration (manifest)](./manifest.md)**.
16
-
17
- :::note{title="Security"}
18
-
19
- Do not put OIDC client secrets, Stripe keys, or other secrets in JSON. Use `.env` with
20
- `APITOGO_CONFIG_AUTHENTICATION__*` (never commit those values).
21
-
22
- :::
23
-
24
- ## Minimal example
25
-
26
- ```json title=config.json
27
- {
28
- "site": {
29
- "title": "My API",
30
- "logo": {
31
- "src": { "light": "/logo-light.png", "dark": "/logo-dark.png" },
32
- "alt": "My API",
33
- "width": "130px"
34
- }
35
- },
36
- "authentication": {
37
- "enabled": true,
38
- "type": "dev-portal"
39
- },
40
- "modules": {
41
- "docs": { "files": "/pages/**/*.{md,mdx}" },
42
- "landing": { "enabled": true, "path": "/", "layout": "landing" },
43
- "userPanel": {
44
- "enabled": true,
45
- "dashboard": { "enabled": true },
46
- "userManagement": { "enabled": true }
47
- }
48
- },
49
- "navigation": [
50
- { "type": "category", "label": "Docs", "items": ["introduction"] },
51
- { "type": "link", "to": "api", "label": "API Reference" }
52
- ],
53
- "redirects": [{ "from": "/", "to": "/introduction" }],
54
- "apis": [{ "type": "file", "input": "./apis/openapi.yaml", "path": "api" }]
55
- }
56
- ```
57
-
58
- Scaffolded projects and MCP (`create_dev_portal` / `apply_product_intent`) produce this layout. You
59
- can change the site via MCP tools or by editing files — see [MCP overview](../mcp/overview.md).
60
-
61
- ## Modules vs legacy root keys
62
-
63
- Prefer `modules.*`:
64
-
65
- | Prefer | Legacy (still migrated on load) |
66
- | --------------------------- | -------------------------------- |
67
- | `modules.docs` | root `docs` |
68
- | `modules.userPanel.apiKeys` | root `apiKeys` |
69
- | `modules.userPanel.plans.*` | root `plans` / `pricing.enabled` |
70
-
71
- ## Common options
72
-
73
- These fields usually live in `apitogo.config.json`.
74
-
75
- ### `apis`
76
-
77
- OpenAPI input as a local file or URL. See [API Reference](./api-reference.md).
78
-
79
- ```json
80
- {
81
- "apis": [
82
- {
83
- "type": "file",
84
- "input": "./apis/openapi.yaml",
85
- "path": "api"
86
- }
87
- ]
88
- }
89
- ```
90
-
91
- ### `site`
92
-
93
- Site title and logo (`site.title`, `site.logo`).
94
-
95
- ### `navigation`
96
-
97
- Top bar and sidebar: categories, links, custom pages (custom pages with React elements belong in
98
- TSX). See [Navigation](./navigation.mdx).
99
-
100
- ### `theme`
101
-
102
- Light/dark theme tokens and optional `customCss`. See
103
- [Colors & theme](../customization/colors-theme.mdx).
104
-
105
- ### `metadata`
106
-
107
- HTML metadata (`title`, `favicon`, `description`, etc.).
108
-
109
- ### `modules.docs`
110
-
111
- Docs glob and options (publish Markdown, LLMs, default page options). Prefer this over root `docs`.
112
- See [Docs module](./docs.md).
113
-
114
- ### `sitemap`
115
-
116
- ```json
117
- {
118
- "sitemap": {
119
- "siteUrl": "https://example.com",
120
- "changefreq": "daily",
121
- "priority": 0.7,
122
- "autoLastmod": true,
123
- "exclude": ["/404"]
124
- }
125
- }
126
- ```
127
-
128
- ### `redirects`
129
-
130
- ```json
131
- {
132
- "redirects": [
133
- { "from": "/", "to": "/introduction" },
134
- { "from": "/docs", "to": "/introduction" }
135
- ]
136
- }
137
- ```
138
-
139
- ### `port`, `basePath`, `canonicalUrlOrigin`, `cdnUrl`, `https`
140
-
141
- Dev-server and hosting helpers (often in JSON or still settable from a TS config for advanced
142
- sites):
143
-
144
- - `port` — default `3000` (CLI `--port` wins)
145
- - `basePath` — host under a subpath
146
- - `canonicalUrlOrigin` — SEO canonical origin
147
- - `cdnUrl` — string or `{ base, media }`
148
- - `https` — `{ key, cert, ca? }` for the local HTTPS server
149
-
150
- ### `enableStatusPages`
151
-
152
- When `true` (default), the build emits static status pages such as `404.html` in `dist`.
153
-
154
- ## Navigation
155
-
156
- Put navigation in `apitogo.config.json`, or keep large trees in a separate module (for example
157
- `sidebar.ts`) and wire them into your site config.
158
-
159
- ## Related
160
-
161
- - [Manifest (`apitogo.config.json`)](./manifest.md)
162
- - [Make config (CLI)](./make-config.mdx) — interactive wizard (`npx apitogo config`)
163
- - [Gateway plans](./plans.md)
164
- - [Authentication](./authentication.md)
165
- - [MCP overview](../mcp/overview.md)
166
- - [Shape with CLI](../cli/shape.md)
1
+ ---
2
+ title: Configuration overview
3
+ sidebar_icon: file-json-2
4
+ description: >-
5
+ One file, apitogo.config.json, describes your API product: the portal, the gateway, sign-in and
6
+ plans. This page shows its sections and where each one is explained.
7
+ ---
8
+
9
+ An APItoGo project is described by **`apitogo.config.json`** at the root of your folder. It has one
10
+ section per service. Leave a section out and that service is not part of the project.
11
+
12
+ ```json title=apitogo.config.json
13
+ {
14
+ "version": 2,
15
+ "project": { "name": "Books API" },
16
+ "portal": {
17
+ "landing": "apitogo/portal/landing/LandingPage.tsx",
18
+ "footer": "apitogo/portal/footer/Footer.tsx",
19
+ "docs": { "content": ["apitogo/portal/pages/**/*.{md,mdx}"] }
20
+ },
21
+ "gateway": {
22
+ "origin": { "mode": "managed", "source": "server", "runtime": "nodejs" },
23
+ "specs": ["apitogo/apis/openapi.yaml"]
24
+ },
25
+ "identity": {},
26
+ "plans": {}
27
+ }
28
+ ```
29
+
30
+ `apitogo create` and `apitogo add` write this file for you, and `apitogo config` changes it. You can
31
+ also edit it by hand: `apitogo check` tells you what is wrong before anything is deployed.
32
+
33
+ ## Sections
34
+
35
+ | Section | What it is | Reference |
36
+ | ---------- | -------------------------------------------------------------------------- | ------------------------------ |
37
+ | `version` | Always `2` | |
38
+ | `project` | The project's name, and its id once `apitogo project create` has linked it | [Below](#project) |
39
+ | `portal` | The developer portal: docs pages, home page, footer, logo, theme, console | [Portal](./portal.md) |
40
+ | `gateway` | Your API behind the gateway: where it runs, its OpenAPI files, the rules | [Gateway](./gateway.md) |
41
+ | `identity` | Sign-in for the people who use your portal | [Sign-in](./authentication.md) |
42
+ | `plans` | The plans people pick, and Stripe for the paid ones | [Plans](./plans.md) |
43
+
44
+ The API page of the portal is made from the gateway's OpenAPI files. See
45
+ [API reference](./api-reference.md).
46
+
47
+ ## The folder
48
+
49
+ Everything the services use, besides the config, lives in the `apitogo/` folder:
50
+
51
+ ```
52
+ apitogo.config.json
53
+ apitogo/
54
+ ├─ plans.json the plans (when the project has plans)
55
+ ├─ apis/openapi.yaml your OpenAPI file (or wherever gateway.specs points)
56
+ └─ portal/
57
+ ├─ pages/ docs pages: Markdown (.md, .mdx) and React (.tsx)
58
+ ├─ landing/LandingPage.tsx the home page
59
+ ├─ footer/Footer.tsx the footer
60
+ ├─ theme.json colors and fonts
61
+ └─ public/ images and files served as they are (logo.svg, ...)
62
+ ```
63
+
64
+ `apitogo/.state/` holds what the CLI generates and what it deployed. It ignores itself in git, and
65
+ you never edit it.
66
+
67
+ ## project
68
+
69
+ ```json
70
+ "project": { "id": "fe3a12b0-fbaf-4315-b37f-b731d930ee57", "name": "Books API" }
71
+ ```
72
+
73
+ - `name`: the project's name, used as the portal's name unless `portal.name` says otherwise.
74
+ - `id`: the platform project this folder deploys to. `apitogo project create` writes it, and
75
+ `apitogo project use <id>` moves the folder to another project. See
76
+ [CLI commands](../cli/commands.md).
77
+
78
+ ## Secrets
79
+
80
+ The config never holds a secret. Where a service needs one (a Stripe key, an OIDC client secret), it
81
+ names a project secret:
82
+
83
+ ```json
84
+ "plans": { "billing": { "apiKey": "secret:STRIPE_API_KEY" } }
85
+ ```
86
+
87
+ Store the value with `npx apitogo secrets set STRIPE_API_KEY`. Deploy asks for the secrets it needs
88
+ and stores them for you. A value written straight into the config is refused.
89
+
90
+ ## Check before you deploy
91
+
92
+ ```bash
93
+ npx apitogo check
94
+ ```
95
+
96
+ `check` reads the config and the files it names, and says what is missing or wrong, with a hint for
97
+ each problem. `deploy` runs the same checks first.
@@ -1,154 +1,144 @@
1
1
  ---
2
- title: Gateway plans
2
+ title: Plans
3
3
  sidebar_icon: tags
4
- description:
5
- Configure end-user API plans in apitogo.config.json — pricing, rate limits, quotas, and publish
6
- behavior.
4
+ description: >-
5
+ The plans your API's users pick: limits, prices, features and endpoints in apitogo/plans.json, and
6
+ Stripe for the paid ones.
7
7
  ---
8
8
 
9
- **Gateway plans** (also called API plans) are what your **end users** subscribe to.
9
+ **Plans** are what the people who use your API choose: a free tier, a paid tier, a contact-us tier.
10
+ Each one has its own limits, and the gateway enforces them on every call made with that plan's API
11
+ key.
10
12
 
11
- - **`/pricing`** — public catalog. Visitors choose a plan before signup. Signed-in users still see
12
- this page; it must not redirect to `/account/plans`.
13
- - **`/account/plans`** — authenticated billing. Sign-in required. Manage and change subscriptions.
13
+ The portal shows them on **`/pricing`** (public) and **`/account/plans`**, where signed-in people
14
+ subscribe, switch and cancel.
14
15
 
15
- They are separate from **platform hosting** (Free / Starter / Professional on APItoGo), which you
16
- select with `npx apitogo deploy --platform-plan`.
16
+ ## Turn plans on
17
17
 
18
- Store the catalog under `modules.userPanel.plans.items` in `apitogo.config.json`.
19
-
20
- ## Shape with the CLI
18
+ ```json title=apitogo.config.json
19
+ {
20
+ "plans": {}
21
+ }
22
+ ```
21
23
 
22
- In a config version 2 project, plans live in `apitogo/plans.json`. `npx apitogo config` adds them
23
- interactively (title, price, rate limit, monthly quota) or with `--plan`. A plan with the same `sku`
24
- is replaced.
24
+ The plans themselves live in **`apitogo/plans.json`**. `apitogo add plans` creates it, and
25
+ `apitogo config` adds plans interactively or with `--plan` (a plan with the same `sku` is replaced):
25
26
 
26
27
  ```bash
27
- npx apitogo config
28
- # choose plan → enter title, price, policies → done when finished
29
28
  npx apitogo config --plan '{"sku":"free","displayName":"Free"}'
30
29
  ```
31
30
 
32
- ## Canonical shape
31
+ ## plans.json
33
32
 
34
- ```json
33
+ ```json title=apitogo/plans.json
35
34
  {
36
- "modules": {
37
- "userPanel": {
38
- "plans": {
39
- "enabled": true,
40
- "items": [
41
- {
42
- "sku": "free",
43
- "displayName": "Free",
44
- "priceAmount": 0,
45
- "limits": {
46
- "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
47
- "quota": { "calls": 50000, "renewalPeriodDays": 30 }
48
- }
49
- },
50
- {
51
- "sku": "pro",
52
- "displayName": "Pro",
53
- "priceAmount": 29,
54
- "priceCurrency": "usd",
55
- "billingPeriod": "month",
56
- "limits": {
57
- "rateLimit": { "calls": 1000, "renewalPeriodSeconds": 60 },
58
- "quota": { "calls": 500000, "renewalPeriodDays": 30 }
59
- }
60
- }
61
- ]
35
+ "version": 1,
36
+ "plans": [
37
+ {
38
+ "sku": "free",
39
+ "displayName": "Free",
40
+ "default": true,
41
+ "limits": {
42
+ "rateLimit": { "calls": 60, "periodSeconds": 60 },
43
+ "quota": { "calls": 1000, "periodDays": 30 }
62
44
  }
45
+ },
46
+ {
47
+ "sku": "pro",
48
+ "displayName": "Pro",
49
+ "priceAmount": 19,
50
+ "priceCurrency": "usd",
51
+ "billingInterval": "month",
52
+ "featured": true,
53
+ "limits": { "rateLimit": { "calls": 600, "periodSeconds": 60 } },
54
+ "features": ["Email support", "Usage history"]
55
+ },
56
+ {
57
+ "sku": "enterprise",
58
+ "displayName": "Enterprise",
59
+ "pricingModel": "custom",
60
+ "priceLabel": "Let's talk"
63
61
  }
64
- }
62
+ ]
65
63
  }
66
64
  ```
67
65
 
68
- - **`sku`** — stable identifier (used in checkout URLs and gateway sync).
69
- - **`displayName`** — label on `/pricing`.
70
- - **`priceAmount`** — `0` for free tiers; greater than zero for paid plans (USD by default).
71
- - **`pricingModel`** — `fixed` (default) or `custom`. See
72
- [Custom pricing](#custom-pricing-contact-sales).
73
- - **`priceLabel`** — optional text shown instead of the price, such as `"Let's talk"` (max 64
74
- characters).
75
- - **`limits`** — rate limit and quota policies (see below). Encoded `limitsJson` strings are still
76
- accepted on load.
66
+ | Field | What it does |
67
+ | ----------------- | -------------------------------------------------------------------------------- |
68
+ | `sku` | The plan's id, unique in the file |
69
+ | `displayName` | The name on the pricing page |
70
+ | `default` | The plan the portal offers first |
71
+ | `limits` | `rateLimit` (`calls` per `periodSeconds`) and `quota` (`calls` per `periodDays`) |
72
+ | `priceAmount` | The price; `0` or left out is free |
73
+ | `priceCurrency` | A currency code such as `usd` or `eur` |
74
+ | `billingInterval` | `month` or `year` |
75
+ | `pricingModel` | `fixed` (default) or `custom` for a contact-us plan |
76
+ | `priceLabel` | The text shown instead of a price, for a contact-us plan |
77
+ | `featured` | Shown as **Popular** |
78
+ | `features` | Extra lines on the plan's card |
79
+ | `includedActions` | The endpoints the plan includes, such as `get:/orders`; left out, all of them |
80
+ | `sortOrder` | The plan's place on the page; by default the file order |
77
81
 
78
- Enable the catalog with `modules.userPanel.plans.enabled: true`. Legacy root `plans` is migrated on
79
- load.
82
+ An unknown field is refused, so a typo never goes unnoticed.
80
83
 
81
- ## limits schema
84
+ ## What a pricing card shows
82
85
 
83
- ```json
84
- {
85
- "rateLimit": { "calls": 100, "renewalPeriodSeconds": 60 },
86
- "quota": { "calls": 50000, "renewalPeriodDays": 30 }
87
- }
88
- ```
86
+ Each card lists, in this order:
87
+
88
+ 1. The limits: `600 requests per minute`, `1,000 requests / month`
89
+ 2. The plan's `features`
90
+ 3. The endpoints it includes: the ones in `includedActions`, or every operation of the gateway
91
+
92
+ `npx apitogo run` shows the same cards as the deployed portal.
89
93
 
90
- - **rateLimit** — maximum calls per renewal window (per minute when `renewalPeriodSeconds` is 60).
91
- - **quota** — longer-window cap (per 30 days when `renewalPeriodDays` is 30).
94
+ ## Paid plans
92
95
 
93
- New plans include **all** discovered OpenAPI operations unless you set `includedActionKeys`. After
94
- OpenAPI is deployed, you can scope a plan to specific operations with `includedActionKeys` (for
95
- example `get:/orders/{id}`). Edit those fields in `apitogo.config.json` — see
96
- [Manifest](./manifest.md).
96
+ A plan with a price is paid through **your own Stripe account**. When the file has one, deploy asks
97
+ for your Stripe secret key, then for the webhook signing secret, and stores both as project secrets.
98
+ [Set up Stripe for paid plans](../guides/stripe-setup.mdx) shows where to find them.
97
99
 
98
- ## Custom pricing (contact sales)
100
+ Free and contact-us plans need no Stripe at all.
99
101
 
100
- Set `pricingModel: "custom"` for plans with negotiated prices, such as an Enterprise tier. Leave
101
- `priceAmount` at `0` or omit it.
102
+ The `billing` settings are only needed to change the defaults:
102
103
 
103
104
  ```json
104
- {
105
- "sku": "enterprise",
106
- "displayName": "Enterprise",
107
- "pricingModel": "custom",
108
- "priceLabel": "Let's talk"
105
+ "plans": {
106
+ "billing": {
107
+ "apiKey": "secret:STRIPE_API_KEY",
108
+ "webhookSecret": "secret:STRIPE_WEBHOOK",
109
+ "successUrl": "https://portal.example.com/account/plans",
110
+ "cancelUrl": "https://portal.example.com/pricing"
111
+ }
109
112
  }
110
113
  ```
111
114
 
112
- On `/pricing`, custom plans show `priceLabel` (or **Custom**) and a **Contact sales** button. The
113
- button opens a public `/contact-sales` form instead of Stripe checkout or registration. Visitors
114
- don't need an account.
115
+ Selling paid plans needs the **Starter** or **Professional** hosting plan. On **Free**, deploy stops
116
+ at a paid plan and says so.
115
117
 
116
- Each submission is emailed to the project's **sales contact email**, or to the project owner's email
117
- when none is set. Custom plans can't be subscribed to through checkout. Custom plans are available
118
- on every platform plan, including Free.
118
+ ## Contact-us plans
119
119
 
120
- ## Publish
120
+ `"pricingModel": "custom"` makes a plan you price per customer. Its card shows `priceLabel` (or
121
+ **Custom**) and a **Contact sales** button, which opens a public form instead of a checkout. Each
122
+ request is emailed to the project's sales contact, or to its owner.
121
123
 
122
- Gateway plans are applied when you run:
124
+ ## Deploy
123
125
 
124
126
  ```bash
125
- npx apitogo deploy
127
+ npx apitogo deploy --only plans
126
128
  ```
127
129
 
128
- `npx apitogo deploy` syncs plans from the manifest to the platform gateway. Paid plans require
129
- Stripe secrets in `.env` before publish — see [Go live with CLI](../cli/go-live.md).
130
-
131
- ## Platform hosting vs gateway plans
132
-
133
- | Kind | What it is | How |
134
- | ----------------------- | ---------------------------------------------- | ------------------------------------ |
135
- | **Platform hosting** | APItoGo bill for hosting your portal + API hub | `npx apitogo deploy --platform-plan` |
136
- | **Gateway / API plans** | What your customers pay for API access | `modules.userPanel.plans.items` |
137
-
138
- ### Free platform limitations
139
-
140
- The **Free** platform plan cannot:
130
+ deploys the plans, their limits on the gateway and the pricing page. A plain `npx apitogo deploy`
131
+ does it together with everything else.
141
132
 
142
- - Publish **paid** gateway plans (`priceAmount > 0`)
143
- - Attach a **custom domain** to the dev portal
133
+ ## Hosting plans are something else
144
134
 
145
- Use **Starter** or **Professional** for paid API tiers, Stripe checkout, and custom domains. If your
146
- manifest has paid plans and you try `npx apitogo deploy --platform-plan free`, deploy is blocked
147
- until you upgrade or zero/remove those paid plans.
135
+ | Kind | What it is | Where |
136
+ | -------------------- | ------------------------------------------------- | ------------------------------- |
137
+ | Your plans | What your users pay you for using your API | `apitogo/plans.json` |
138
+ | APItoGo hosting plan | What you pay APItoGo: Free, Starter, Professional | `apitogo project create --plan` |
148
139
 
149
140
  ## Related
150
141
 
151
- - [Manifest](./manifest.md)
152
- - [Make config (CLI)](./make-config.mdx)
153
- - [Authentication](./authentication.md)
154
- - [Go live with CLI](../cli/go-live.md)
142
+ - [Set up Stripe for paid plans](../guides/stripe-setup.mdx)
143
+ - [Your customers' account pages](../guides/customer-account.md)
144
+ - [Gateway](./gateway.md)
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: Portal
3
+ sidebar_icon: layout-template
4
+ description: >-
5
+ The portal section of apitogo.config.json: docs pages, home page, footer, logo, theme, console,
6
+ search and who may see the portal.
7
+ ---
8
+
9
+ The `portal` section is your developer portal: the docs, the API page, the home page and the console
10
+ where people sign in, pick a plan and get API keys.
11
+
12
+ ```json title=apitogo.config.json
13
+ {
14
+ "portal": {
15
+ "name": "Books API",
16
+ "docs": { "content": ["apitogo/portal/pages/**/*.{md,mdx}"] },
17
+ "landing": "apitogo/portal/landing/LandingPage.tsx",
18
+ "footer": "apitogo/portal/footer/Footer.tsx",
19
+ "logo": "apitogo/portal/public/logo.svg",
20
+ "theme": "apitogo/portal/theme.json",
21
+ "search": "pagefind",
22
+ "requireAuth": false
23
+ }
24
+ }
25
+ ```
26
+
27
+ `"portal": {}` is enough: every setting has a default. `apitogo add portal` writes the section and
28
+ its starter files.
29
+
30
+ ## Settings
31
+
32
+ | Setting | Default | What it does |
33
+ | ------------- | ------------------------------------ | --------------------------------------------------------------------------- |
34
+ | `name` | `project.name` | The name in the header and the page titles |
35
+ | `docs` | `apitogo/portal/pages/**/*.{md,mdx}` | Where the docs pages are, or an external docs site ([below](#docs)) |
36
+ | `landing` | none | A React file shown at `/`, the home page |
37
+ | `footer` | none | A React file shown under every page except the console's |
38
+ | `logo` | none (the header shows `name`) | The header logo ([below](#logo)) |
39
+ | `theme` | `apitogo/portal/theme.json` | Colors and fonts ([Colors & theme](../customization/colors-theme.mdx)) |
40
+ | `console` | `{ "enabled": true }` | The sign-in, plans, keys and usage pages, when identity or plans is on |
41
+ | `search` | `pagefind` | `pagefind`, `inkeep` or `none` |
42
+ | `requireAuth` | `false` | Only signed-in people may see the portal ([below](#who-may-see-the-portal)) |
43
+ | `dir` | `apitogo/portal` | The portal's folder, if you keep it somewhere else |
44
+ | `enabled` | `true` | `false` keeps the section but leaves the portal out of deploys |
45
+
46
+ ## docs
47
+
48
+ The docs pages are the Markdown and React files in `apitogo/portal/pages/`. Name other places with
49
+ `content` (globs, relative to the config):
50
+
51
+ ```json
52
+ "docs": { "content": ["docs/**/*.{md,mdx}", "guides/**/*.md"] }
53
+ ```
54
+
55
+ React pages (`.tsx`) in the same folders are found too. The sidebar is built from the files: a
56
+ folder becomes a section, and `order` in a page's frontmatter sorts it. See
57
+ [Writing](../writing.mdx) and [Custom pages](../guides/custom-pages.md) for React pages.
58
+
59
+ If your docs live on another site, link it instead. The portal then has no docs pages of its own:
60
+
61
+ ```json
62
+ "docs": { "provider": "external", "url": "https://docs.example.com" }
63
+ ```
64
+
65
+ ## Home page and footer
66
+
67
+ `landing` and `footer` each name a React file in your folder. `apitogo add portal` writes both,
68
+ built from the sections of `@lukoweb/apitogo-module-landing`, and you change them freely. Remove the
69
+ setting to have none. See [Landing page](../customization/landing-page.md) and
70
+ [Footer](./footer.mdx).
71
+
72
+ When there is a home page, `/` shows it, and an `index` page of the docs opens at `/index`.
73
+
74
+ ## logo
75
+
76
+ An image in the portal's `public/` folder, or an `https://` address:
77
+
78
+ ```json
79
+ "logo": "apitogo/portal/public/logo.svg"
80
+ ```
81
+
82
+ One image per color scheme, with the text read out by screen readers:
83
+
84
+ ```json
85
+ "logo": {
86
+ "light": "apitogo/portal/public/logo.svg",
87
+ "dark": "apitogo/portal/public/logo-dark.svg",
88
+ "alt": "Books API"
89
+ }
90
+ ```
91
+
92
+ `apitogo check` refuses a file that does not exist or is not in `public/`.
93
+
94
+ ## Who may see the portal
95
+
96
+ By default everyone may read the docs and the API page. `requireAuth` asks people to sign in first
97
+ (it needs `identity`):
98
+
99
+ ```json
100
+ "requireAuth": true
101
+ ```
102
+
103
+ Keep some pages public:
104
+
105
+ ```json
106
+ "requireAuth": { "exclude": ["/introduction", "/pricing"] }
107
+ ```
108
+
109
+ ## Console
110
+
111
+ The console pages appear on their own when the project has `identity` (sign-in) or `plans` (pricing,
112
+ API keys, usage). Turn them off with:
113
+
114
+ ```json
115
+ "console": { "enabled": false }
116
+ ```